IaC (CFN) Flashcards

1
Q

What’s the difference between CloudFormation logical and physical resources?

A

Logical - The resource as defined in a CFN template.

Physical - The actual resources created when a template is applied.

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

What are CFN stacks?

A

Organizational units for physical resources with a logical boundary - they are isolated and self-contained by default.

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

What is the importance of DependsOn?

A

Many resources have implicit dependencies (in terms of create order) that CFN can auto-detect, especially in the presence of !Refs.

DependsOn allows the specification of explicit dependencies that CFN cannot auto-detect, such as an ElasticIP resource.

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

What is the CFN Stack resource limit?

A

500.

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

What are some other limits of CFN stacks and templates that Nested Stacks can help with?

A
  • Shared lifecycle.
  • Can’t easily reference other stacks.
  • Can’t easily reuse resources like VPCs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What CFN directive is used by stacks to reference each other?

A

The Outputs directive, which can be referenced or used as parameters for other templates/stacks.

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

What is the main difference between Cross-Stack References and Nested Stacks?

A

Nested stacks are for lifecycle-linked resources and help with code (template) re-use, NOT with resource re-use or sharing.

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

What CFN Directives are useful for Cross-Stack References?

A

Export, inside a single Output, paired with !ImportValue.

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

What are CFN StackSets?

A

Containers for Stack Instances (which themselves reference actual Stacks), and used to deploy Stacks across many Accounts and Regions.

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

What are the uses of a CFN DeletionPolicy?

A

By default, CFN deletes physical resources when the logical resource is deleted. DeletionPolicies can instruct CFN to either Retain or Snapshot the physical resources, depending on individual resource support for these actions.

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

What is the purpose of CFN Stack Roles?

A

Used for role separation, where a user with Stack-based access can pass an IAM Role to CFN that itself has the permissions to CRUD the resources.

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

What is CloutFormationInit?

A

A system to describe a desired state for EC2 instances, as an alternative to defining procedural steps in the user-data. Is idempotent.

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

What’s the use case for cfn-hup?

A

This helper daemon can detect changes in resource metadata and run configuration actions.

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

Is user-data, even when parameterized, re-applied during stack updates?

A

No. The user-data is run only once, when the stack and physical resources are first created.

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

Where is the output of the user-data process captured on the EC2 instance (Linux)?

A

In the /var/log/cloud-init-output.log file.

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

What are CFN Change Sets?

A

A preview of a stack update that can be reviewed for accuracy or other concerns, especially if resources will be disrupted or outright replaced.

17
Q

What is the purpose of CFN Custom Resources?

A

To allow CFN to integrate with anything it doesn’t yet or doesn’t natively support.

18
Q

How do Custom Resources work during stack updates?

A

Event data is sent to a Lambda or SNS topic and can receive data back about the state of that resource.