CloudFormation Flashcards

1
Q

What are Change Sets?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are Cross-Stack References?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a DeletionPolicy?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the DependsOn attribute used for?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Intrinsic Functions?

A

built-in functions that we can use to manage our stacks by assigning values to properties that are not available until runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are examples of Intrinsic Functions?

A

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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are Mappings?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are Nested Stacks?

A

These are stacks created as part of other stacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the limit on a single stack?

A

A single stack has a limit of 500 resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Are root stacks created automatically or manually?

A

The root stack is the one stack that is created manually

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a Parent Stack?

A

A stack is a parent stack of any stack which it directly creates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can Nested Stacks reuse resources actually created by another stack?

A

No. Nested stacks can reuse templates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can Cross-Stack References reuse templates?

A

No. Cross-stack references reuse resources actually created by another stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When should Nested Stacks be used?

A

Nested stacks should only be used when everything is lifecycle linked. If not, cross-stack references may be a better choice.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are Outputs?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Can sensitive information be stored in Outputs?

A

No. CloudFormation doesn’t redact or obfuscate any information you include in the Outputs section. We strongly recommend you don’t use this section to output sensitive information, such as passwords or secrets.

17
Q

What is the structure of an Output and what is the max amount that can be declared on a single template?

A

The Outputs section consists of the key name Outputs, followed by a space and a single colon. You can declare a maximum of 200 outputs in a template

18
Q

What two methods can be used in providing input to a template which can influence what resources are provisioned, and the configuration of those resources?

A

Template Functions and Pseudo Parameters.

19
Q

What is the difference between Template Functions and Pseudo Parameters?

A

Template functions require input from the user, whereas pseudo parameters are inserted automatically via AWS.

20
Q

What are Resources?

A

Declares the AWS resources that you want to include in the stack, such as an Amazon EC2 instance or an Amazon S3 bucket

21
Q

True/False. CloudFormation templates contain logical resources that define How we want created, and leave the WHAT up to the CFN product.

A

False. CloudFormation templates contain logical resources that define WHAT we want created, and leave the HOW up to the CFN product.

22
Q

True/False. CloudFormation templates create stacks, and stacks create physical resources from the logical resources.

A

True.

23
Q

True/False. Stacks keep physical and logical resources in-sync. If a stack’s template is changed the physical resources will also be changed.

A

True.

24
Q

True/False. if a stack is deleted, the physical resources will not be deleted (in most cases)

A

False. If a stack is deleted, the physical resources WILL also be deleted (in most cases)

25
Q

What are StackSets?

A

StackSets are a feature of CloudFormation allowing infrastructure to be deployed and managed across multiple regions and multiple accounts from a single location.

Additionally, it adds a dynamic architecture — allowing automatic operations based on accounts being added or removed from the scope of a StackSet.

26
Q

What permissions do CloudFormation use by default?

A

By default, CloudFormation uses the permissions of the logged-in identity.

27
Q

True/False. To use CloudFormation effectively, we need access to both stacks and the resources which those stacks are trying to create/update/delete.

A

True.

28
Q

What are Stack Roles?

A

Stack roles allow an IAM role to be passed into the stack via PassRole. A stack can then use this role, rather than the identity interacting with the stack to create, update, and delete AWS resources.

29
Q

What can be used together to prevent the status of a resource from reaching ‘create complete’ until CloudFormation receives a specified number of success signals or the timeout period has been exceeded?

A

CreationPolicy, WaitConditions, and cfn-signal