Skip to main content
  1. Projects/
  2. Certification: AWS DevOps Pro/
  3. 2: Configuration Mgmt / Infrastructure as Code/
  4. 2: CloudFormation/

5: Updating CF Stacks

·1 min

How does one update a CF stack?

(Say we need to size up our ec2 instance)

  1. Submit updated template
  2. CF compares changes
  3. Only changed resources are changed

Ways:

  1. “Direct Update” (just go for it)
  2. “Change set” (Gives ability to do a dry-run / preview)

Potential update behaviors?

(Varies by resource type)

1. Update w/ no interruption

  • Updates resource w/o disrupting ops nor physical ID
  • E.g. Instance profile

2. Update w/ some interruption

  • Updates w/ some interruption. Physical ID retained
  • E.g. HostId

3. Replacement

  • Total recreation / new physical ID.
  • E.g. availability zone

Direct changes or change sets?

  • Change sets are good for prod
  • Direct is fine for dev or test

How to utilize update behaviors?

  • Dictates how to modify resources
  • Don’t do a full “replacement” if you need to retain physical ID label