18. CloudFormation Flashcards

1
Q

What are the CloudFormation template components?

A
  1. Resources (MANDATORY)
  2. Parameters
  3. Mappings
  4. Outputs
  5. Conditionals
  6. Metadata
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are CloudFormation parameters?

A

Parameters are a way to provide inputs to your CloudFormation template. They’re important for when you want to REUSE templates across the company

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

Can you create a dynamic amount of resources using CloudFormation?

A

No. Everything in the CloudFormation template has to be declared. You can’t perform code generation there

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

How do you reference a parameter in CloudFormation?

A

Fn::Ref

!Ref in YAML

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

What are CloudFormation mappings?

A

Mappings are fixed variables within your CloudFormation Template. They’re handy to differentiate between different environments (dev vs prod). All the values are hardcoded within the template

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

How do you reference a mapping in CloudFormation?

A

Fn::FindInMap

!FindInMap in YAML

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

How do you reference an attribute in CloudFormation?

A

Fn::GetAtt

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

What is the default CloudFormation Rollback for stack creation failure?

A

Everything rolls back (gets deleted)

  • we can look at the log
  • option to disable rollback and troubleshoot what happened
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the default CloudFormation Rollback for stack update failure?

A

The stack will automatically rollback to the previous known working state
- ability to see in the log what happened and error messages

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

What do you use to create, update, or delete stacks across multiple accounts and regions with a single operation?

A

CloudFormation StackSets

  • administrator account to create StackSets
  • when you update a stack set, all associated stack instances are updated throughout all accounts and regions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which section of a CloudFormation template does not allow for conditions?

A

Parameters

Parameters enable you to input custom values to your CloudFormation template each time you create or update a stack.

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

Exported Output Values in CloudFormation must have unique names:

a. within a single Region
b. across all Regions

A

Exported Output Values in CloudFormation must have unique names within a single Region

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

When are CF cross stacks helpful?

A
  • when stacks have different life cycles
  • when you need to pass export values to many stacks (VPC ID, etc)

Cross stacks use Outputs Export and Fn::ImportValue

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

When are CF nested stacks helpful?

A
  • when components must be reused (ex: reuse how to properly configure an ALB)
  • the nested stack is only important to the higher level stack (it’s not shared)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly