CloudFormation 2 Flashcards
Deletion Policy
What is CFN DeletionPolicy?
Attribute on a Resource. When true, deleting the stack will leave the resource intact.
Deletion Policy
What are the three values for DeletionPolicy
?
Delete, Retain, Snapshot (takes a snapshot of a DB, then deletes it)
Deletion Policy
If you mark a Resource with “Retain” on deletion, can it be deleted?
YES, if a change requires delete-then-create, or if you just want to delete it youself.
Stack Roles, Change Sets
Normally need permission to create everything. That’s a lot. How deal with this?
Create a Stack Role: Role with permissions to do everything. Use PASS ROLE to use it.
Stack Roles, Change Sets
What’s PassRole?
You have permission to give the roll to something (CFN), but not to assume it yourself.
Stack Roles, Change Sets
About to deploy a tmpl, but worried it might delete-then-create a RDS database.
ChangeSet: see what it would do, let it proceed or stop it.
Stack Roles, Change Sets
How can you prevent changes to a Stack from altering certain high-value resources?
Use a CloudFormation Stack Policy and deny updates explicitly.
Wait and Signal
What is the typical use case for Wait+Signal?
Provision an EC2, have CFN wait around until EC2 up and ready and tells CFN that it’s done
Wait and Signal
How do you configure wait+Signal?
Pick number of success messages needed to continue, and a timeout
Wait and Signal
What is the actual service on an EC2 instance that can tell a CFN stack to continue?
cfn-signal
Wait and Signal
What can cfn-signal communicate back to the stack?
Success or Failed
Wait and Signal
What do you put in a CFN template to say it should wait for a signal?
CreationPolicy if EC2 or ASG, WaitCondition otherwise
Wait and Signal
Why both a CreationPolicy and a WaitCondition exist?
CreationPolicy built into the CFN schema for EC2 and ASG
Wait and Signal
How do you use a WaitCondition?
Issues a pre-signed URL. Anything using this PSU can tell CFN to continue
Wait and Signal
What are Signals?
Set per-resource in CFN stack. Call to the AWS SDK when the CFN stack is waiting. When the Signal is called, CFN unblocks.