A simple command line tool for creating, updating and deleting AWS projects created via CloudFormation.
This project was created as an alternative to all 'heavy' frameworks being created for launching serverless applications. The intention is to provide a lightweight alternative that is very easy to get started with but on the other hand doesn't provide much in terms of functionality.
npm install -g aws-cloudformation-simple-cli
For a complete list of arguments, run
aws-cfn help
aws-cfn update --config-file path/to/local-config-file.json --placeholder {PH1}=RP1 --placeholder $PH2$=RP2 --wait false
aws-cfn update --config-file path/to/local-config-file.json --dry-run true --environment test
aws-cfn delete --config-file path/to/local-config-file.json --wait false
--dry-run
: Set to true if you want to preview the CloudFormation request. Default isfalse
.--wait
: Set to true if you want the client to wait for the operation to complete before returning. Default istrue
.--environment
: Switch between environments in the local config file. See Configuration for more details. Default isnone
.--placeholder
: Placeholders for replacement of values in the config.json file. You can supply multiple placeholder arguments. Each placeholder is globally replaced. Syntax:PlaceholderString=ReplacementValue
.
The local configuration file describes all CloudFormation request parameters.
It expects either at least one environment to be defined or a default
configuration set.
If an environment is provided and there is a default config, any settings not defined under the environment will be merged with the default set. The environment settings takes precedence.
See the CloudFormation docs for available configuration properties.
{
"default": {
"StackName": "DefaultStackName",
"Parameters": {
"MyTemplateParamKey": "MyTemplateParamValue",
"MyOtherTemplateParamKey": "MyOtherTemplateParamValue"
},
"TemplateBody": "path/to/my-local-cloudformation.template",
"Capabilities": [
"CAPABILITY_IAM"
]
},
"test": {
"StackName": "TestStackName",
"Parameters": {
"MyTemplateParamKey": "OverrideMyTemplateParamValue"
},
"TemplateURL": "http://s3-bucket-url/cloudformation.template"
}
}
Some CloudFormation request params are expected to be "one of". These params, and which takes precedence if both are provided are listed below.
StackPolicyURL
&StackPolicyBody
.StackPolicyURL
takes precedence.StackPolicyDuringUpdateURL
&StackPolicyDuringUpdateBody
.StackPolicyDuringUpdateURL
takes precedence.TemplateURL
&TemplateBody
.TemplateURL
takes precedence.
- Exit with error code on error
- Fixed help command
- Added
--force-clean-up
argument
Version 1.0.0 is a complete re-write of the tools inner workings.
- All stack creation/updates are now managed via ChangeSets to reduce complexity.
- Template validation has been added, it is also executed on dry run.
- The cli is backwards compatible with stacks created using an earlier version and it has the same api.
- Note that the new version requires a few additional IAM permissions for managing the ChangeSets.
- The
create
&createOrUpdate
commands have been deprecated and will be removed in 2.0.0. Useupdate
for all operations exceptdelete
.
- Bugfix: Switched create vs update commands in createOrUpdate
- Added
createOrUpdate
command which will either create or update the stack depending on wether it exists or not.
- Bugfix: Incorrect casing on options.js require in index.js
- Added response message when update is not executed because there are no changes
- Added support for placeholder arguments
- Stricter argument validation
Notes for the maintainer only.
- Update package.json version
- git tag -a version -m "" && git push --follow-tags
- npm publish