AWS CloudFormation Flashcards

(24 cards)

1
Q

What is AWS CloudFormation?

A

A service that allows you to model, provision, and manage AWS resources using templates as code (JSON/YAML).

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

What is a CloudFormation template?

A

A JSON or YAML file that defines AWS resources and their configurations.

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

What are the main sections of a CloudFormation template?

A

AWSTemplateFormatVersion, Description, Parameters, Mappings, Conditions, Resources, Outputs.

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

What is an AWS CloudFormation stack?

A

A collection of AWS resources created and managed as a single unit from a template.

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

What is a change set in CloudFormation?

A

A summary of proposed changes to a stack before applying them, allowing preview before execution.

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

What are Parameters used for in a template?

A

To pass input values to a template, allowing dynamic configuration at stack creation or update.

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

What are Mappings in CloudFormation?

A

Fixed key-value pairs (like region-specific AMI IDs) used for lookups in templates.

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

What are Conditions in CloudFormation?

A

Logical statements that control resource creation or configuration based on parameter values.

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

What are Outputs in CloudFormation?

A

Values that you can export from one stack to reference in another stack or for end-user information.

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

What is the DependsOn attribute used for?

A

To specify resource creation order when dependencies exist between resources.

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

How do you manage resources across multiple stacks?

A

Using nested stacks, which allow one stack to reference another stack as a resource.

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

What is the difference between UpdatePolicy and DeletionPolicy?

A

UpdatePolicy manages how a resource updates (e.g., rolling updates for Auto Scaling), while DeletionPolicy controls resource deletion behavior (retain, delete, snapshot).

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

Name some common resource types in CloudFormation.

A

AWS::EC2::Instance, AWS::S3::Bucket, AWS::IAM::Role, AWS::RDS::DBInstance, AWS::Lambda::Function.

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

What are the main CloudFormation stack operations?

A

Create, Update, Delete, and Rollback.

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

What is a stack drift?

A

When actual resources differ from the template definition. Detected via stack drift detection.

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

How can you import existing resources into CloudFormation?

A

Using resource import, which allows adding existing AWS resources to a stack without replacement.

17
Q

What is the difference between ROLLBACK and UPDATE_ROLLBACK?

A

ROLLBACK occurs after a failed stack creation, while UPDATE_ROLLBACK occurs after a failed stack update.

18
Q

What is CloudFormation StackSets?

A

A way to deploy stacks across multiple AWS accounts and regions from a single template.

19
Q

What is intrinsic function !Ref?

A

Returns the value of a parameter or the physical ID of a resource.

20
Q

What is intrinsic function !GetAtt?

A

Retrieves an attribute value (like DNSName) of a resource.

21
Q

Name some other common intrinsic functions.

A

!Join, !Sub, !ImportValue, !FindInMap, !Select.

22
Q

How do you handle secrets in CloudFormation?

A

Use AWS Secrets Manager or SSM Parameter Store references ({{resolve:secretsmanager:secret-id}}) instead of hardcoding values.

23
Q

Name key CloudFormation best practices.

A
  1. Modularize templates with nested stacks.
  2. Use parameters, mappings, and conditions for flexibility.
  3. Avoid hardcoding sensitive values; use Secrets Manager or SSM.
  4. Use ChangeSets to preview updates.
  5. Monitor stack events for debugging failures.
  6. Version control templates in Git.
24
Q

How should you organize large templates?

A

Break them into nested stacks or macro templates to improve readability and reusability.