CloudFormation Flashcards
What are Change Sets?
Change sets allow us to preview how proposed changes to a stack might impact our running resources.
For example, using a change set we can see whether making a change to our stack would delete or replace any critical resources.
We can then decide if we’d like to apply the proposed changes or not.
What are Cross-Stack References?
Are used to export resources from one AWS CloudFormation stack to another
Exports must have a unique name in the region of the account they are located in. Different accounts in the same region, however, may have exports with the same name.
Fn::ImportValue can be used instead of Ref to access outputs exported from other stacks.
What is a DeletionPolicy?
An attribute on any or all of our resources to indicate whether we want our resource deleted, retained, or have a snapshot taken when the corresponding logical resource or stack is deleted.
It is important to note, however, that not all resources support retaining or having snapshots taken.
What is the DependsOn attribute used for?
By default, CloudFormation tries to determine a dependency order by seeing which resources reference other resources.
DependsOn attribute allows us to explicitly define what resources depend on other resources.
What are Intrinsic Functions?
built-in functions that we can use to manage our stacks by assigning values to properties that are not available until runtime.
What are examples of Intrinsic Functions?
Ref — Returns the value of the specified parameter or resource.
Fn::GetAtt — Returns the value of an attribute from a resource in the template. Fn::Join — Appends a set of values into a single value, separated by the specified delimiter. Fn::Split — Splits a string into a list of string values. Fn::GetAZs — Returns an array that lists Availability Zones for a specified region in alphabetical order. Fn::Select — Returns a single object from a list of objects by index. This function doesn’t check for null values or if the index is out of bounds of the array, so it’s important to be certain the chosen index is valid to avoid stack errors. Fn::Base64 — Returns the Base64 representation of the input string. Fn::Sub — Substitutes variables in an input string with values that we specify. Fn::Cidr — Returns an array of CIDR address blocks. Conditional intrinsic functions such as Fn::If, Fn::Equals, Fn::Not, Fn::And, Fn::Or.
What are Mappings?
Matches a key to a corresponding set of named values. For example, if you want to set values based on a region, you can create a mapping that uses the region name as a key and contains the values you want to specify for each specific region.
What are Nested Stacks?
These are stacks created as part of other stacks
What is the limit on a single stack?
A single stack has a limit of 500 resources.
Are root stacks created automatically or manually?
The root stack is the one stack that is created manually
What is a Parent Stack?
A stack is a parent stack of any stack which it directly creates.
Can Nested Stacks reuse resources actually created by another stack?
No. Nested stacks can reuse templates.
Can Cross-Stack References reuse templates?
No. Cross-stack references reuse resources actually created by another stack.
When should Nested Stacks be used?
Nested stacks should only be used when everything is lifecycle linked. If not, cross-stack references may be a better choice.
What are Outputs?
Declares output values that you can import into other stacks (to create cross-stack references), return in response (to describe stack calls), or view on the AWS CloudFormation console.