CloudFormation 1 Flashcards
Nested Stacks
What are Nested Stacks?
Multi-level tree of stacks that all deploy together, succeed/fail together, delete together
Nested Stacks
What about resourcees in a stack and individual lifecycles?
All resources in a single stack share a common lifecycle (live and die together)
Nested Stacks
Max number of resources in a single CFN Stack?
500
Nested Stacks
Why aren’t single-stack solutions a good idea in an enterprise?
Can’t re-use anything in a stack
Nested Stacks
How do you set up Nested Stacks?
AWS::CloudFormation::Stack resource, points to a URL where the template lives
Nested Stacks
How do parent-child stacks communicate?
Parent passes Parameters to child, child’s Outputs referencable in parent stack
Nested Stacks
How can a parent stack reference individual resources in a child stack?
Can’t. Parent can only reference the child’s Outputs section
Nested Stacks
How do you control the sequence of parent resources and multiple child stacks?
DependsOn
Nested Stacks
When should you use Nested Stacks over Cross-Stack References or StackSets?
important
Single AWS account, need whole set to succeed or fail together as a unit., Lifecycle-Linked
Nested Stacks
What should you do if you want to share template components across multiple stacks?
Nested Stacks
Nested Stacks
If a template creates a VPC and it’s a child template in two Nested Sets, how many VPCs do you have?
Two. You’re sharing the template, not the resources it creates.
Cross-stack References
What are Cross-stack References?
Two independent Stacks, one has a dependency on a resource in the other
Cross-stack References
How do you use cross-stack references?
important
One uses Export
in Outputs
section, other uses Fn::ImportValue
(not “!Ref”!)
Cross-stack References
What are the constraints on names in Exports
section?
important
They have to be unique in the region in your AWS account
Cross-stack References
How do you !ImportValue
from an Export in a different AWS account?
Can’t. This is only within one AWS account