Deployments
Table of Contents
1. AWS CLI
To deploy a stack defined in Cloudformation we can use the aws deploy
command:
aws cloudformation deploy --stack-name my-cool-stack --template-file my-cool-stack.yaml --capabilities CAPABILITY_IAM --parameters-overrides "MyParameter=value" "MyOtherParameter=value"
The --capabilities
flag is required if your template includes resources that affect permissions on your account, e.g. one of your resources is a AWS::IAM::Role
.
Another flag omitted above is the --no-execute-changeset
which allows you view and confirm your changes before executing the change set.
deploy
is a wrapper around CreateChangeSet
, CreateStack
, and UpdateStack
; we can use deploy
whether the stack already exists or not.
2. Updating Stacks
Updating a Cloudformation resource will either result in:
- Update with No Interruption: the update occurs with no disruption to existing resources. The resource's physical ID (e.g. EC2 instance ID or an S3 bucket name) is not changed.
- Updates with Some Interruption: There may be some interruption updating the resource
- Replacement: The resource is recreated during the update and thus its physical ID is also changed.