What is AWS CloudFormation?
A service that allows you to model, provision, and manage AWS resources using templates as code (JSON/YAML).
What is a CloudFormation template?
A JSON or YAML file that defines AWS resources and their configurations.
What are the main sections of a CloudFormation template?
AWSTemplateFormatVersion, Description, Parameters, Mappings, Conditions, Resources, Outputs.
What is an AWS CloudFormation stack?
A collection of AWS resources created and managed as a single unit from a template.
What is a change set in CloudFormation?
A summary of proposed changes to a stack before applying them, allowing preview before execution.
What are Parameters used for in a template?
To pass input values to a template, allowing dynamic configuration at stack creation or update.
What are Mappings in CloudFormation?
Fixed key-value pairs (like region-specific AMI IDs) used for lookups in templates.
What are Conditions in CloudFormation?
Logical statements that control resource creation or configuration based on parameter values.
What are Outputs in CloudFormation?
Values that you can export from one stack to reference in another stack or for end-user information.
What is the DependsOn attribute used for?
To specify resource creation order when dependencies exist between resources.
How do you manage resources across multiple stacks?
Using nested stacks, which allow one stack to reference another stack as a resource.
What is the difference between UpdatePolicy and DeletionPolicy?
UpdatePolicy manages how a resource updates (e.g., rolling updates for Auto Scaling), while DeletionPolicy controls resource deletion behavior (retain, delete, snapshot).
Name some common resource types in CloudFormation.
AWS::EC2::Instance, AWS::S3::Bucket, AWS::IAM::Role, AWS::RDS::DBInstance, AWS::Lambda::Function.
What are the main CloudFormation stack operations?
Create, Update, Delete, and Rollback.
What is a stack drift?
When actual resources differ from the template definition. Detected via stack drift detection.
How can you import existing resources into CloudFormation?
Using resource import, which allows adding existing AWS resources to a stack without replacement.
What is the difference between ROLLBACK and UPDATE_ROLLBACK?
ROLLBACK occurs after a failed stack creation, while UPDATE_ROLLBACK occurs after a failed stack update.
What is CloudFormation StackSets?
A way to deploy stacks across multiple AWS accounts and regions from a single template.
What is intrinsic function !Ref?
Returns the value of a parameter or the physical ID of a resource.
What is intrinsic function !GetAtt?
Retrieves an attribute value (like DNSName) of a resource.
Name some other common intrinsic functions.
!Join, !Sub, !ImportValue, !FindInMap, !Select.
How do you handle secrets in CloudFormation?
Use AWS Secrets Manager or SSM Parameter Store references ({{resolve:secretsmanager:secret-id}}) instead of hardcoding values.
Name key CloudFormation best practices.
How should you organize large templates?
Break them into nested stacks or macro templates to improve readability and reusability.