Explore AWS CloudFormation MCQ questions and answers designed to deepen your understanding of infrastructure management. Covering critical topics such as stack management (create, update, delete), stack drift detection, change sets, CloudFormation Designer, and stack policies and rollbacks, this set of questions is perfect for cloud professionals and certification aspirants.
Chapter 4: Managing Infrastructure with CloudFormation
1-10: Stack Management (Create, Update, Delete)
What is the primary function of AWS CloudFormation? a) To deploy applications on EC2 b) To automate the creation and management of resources c) To monitor application logs d) To perform data analytics
What is the first step in creating a stack in CloudFormation? a) Define the stack’s resources using a template b) Configure IAM roles c) Set up CloudWatch alarms d) Assign a name to the stack
How can you update an existing CloudFormation stack? a) Modify the stack template and update the stack b) Delete the stack and create a new one c) Edit the stack parameters directly d) Manually add resources to the stack
What happens if an error occurs during a stack update? a) The stack is automatically rolled back to its previous state b) The stack update is skipped c) Only the new resources are updated d) The stack is deleted
What must you define in a CloudFormation template to create resources? a) Parameters, resources, and outputs b) Only parameters c) Only resources d) Only outputs
Which AWS service is often integrated with CloudFormation to automate the creation of resources? a) AWS Lambda b) AWS CodeDeploy c) AWS CloudTrail d) AWS Elastic Beanstalk
Which AWS resource is used for organizing multiple CloudFormation stacks? a) CloudFormation StackSet b) Amazon RDS c) AWS Config d) Amazon EC2
When deleting a stack, which resources are automatically deleted? a) Only the resources created by CloudFormation b) All AWS resources in the account c) Only S3 buckets d) Only EC2 instances
What is the benefit of using CloudFormation StackSets? a) It allows managing CloudFormation stacks across multiple accounts and regions b) It enhances template validation c) It increases the speed of resource creation d) It automates the rollback of resources
How does CloudFormation handle dependencies between resources during stack creation? a) It creates resources in a sequential order based on dependencies b) It creates resources in parallel, regardless of dependencies c) It ignores dependencies during resource creation d) It requires manual intervention
11-15: Stack Drift Detection and Change Sets
What is the purpose of Stack Drift Detection in CloudFormation? a) To identify changes made to stack resources outside of CloudFormation b) To remove unused resources from the stack c) To check for billing anomalies in the stack d) To track deployment logs
What is a Change Set in AWS CloudFormation? a) A set of updates to be applied to a stack b) A backup of the stack template c) A history of stack updates d) A report of resource usage
How can Stack Drift Detection help with troubleshooting? a) By identifying configuration drift and differences between the stack’s expected and actual state b) By providing application logs c) By rolling back changes automatically d) By optimizing resource allocation
How does a CloudFormation Change Set improve deployment safety? a) By showing what changes will be made before applying them b) By automatically applying changes to all resources c) By limiting stack creation to specific regions d) By reducing the number of resources
How can you review the changes proposed by a Change Set? a) By reviewing the changes in the AWS Management Console or AWS CLI b) By contacting AWS support c) By using Amazon QuickSight d) By creating a new stack
16-20: AWS CloudFormation Designer
What is AWS CloudFormation Designer used for? a) To visually design and modify CloudFormation templates b) To deploy stacks c) To analyze CloudFormation logs d) To configure IAM roles
Which feature of AWS CloudFormation Designer allows you to create resource relationships? a) Visual diagram editor b) CloudFormation Template Builder c) Resource Summary Panel d) AWS Config Visualizer
How does CloudFormation Designer help with template creation? a) By providing drag-and-drop functionality for resource creation b) By generating IAM roles automatically c) By checking template syntax errors in real-time d) By setting up CloudWatch metrics
In CloudFormation Designer, what does the “Validate” button do? a) It checks for syntax errors in the CloudFormation template b) It starts the stack creation process c) It initiates the CloudFormation update d) It executes a drift detection
Which file format does AWS CloudFormation Designer support for saving templates? a) JSON and YAML b) CSV and TSV c) XML and HTML d) TXT and PDF
21-25: Stack Policies and Rollbacks
What is the purpose of a Stack Policy in AWS CloudFormation? a) To define which resources are protected from changes during stack updates b) To provide monitoring for the stack c) To define rollback settings d) To enable stack scaling
When is a rollback triggered in CloudFormation? a) When an error occurs during stack creation or update b) When resources are deleted manually c) When the stack’s health is marked as “unhealthy” d) When a template is modified
How does CloudFormation ensure that stack updates do not cause resource destruction? a) By using stack policies to prevent changes to certain resources b) By applying the updates to all resources without restriction c) By disabling all resource modifications d) By automatically scaling down resources
What happens when a rollback occurs during a stack update? a) CloudFormation restores the stack to its previous state b) All resources are permanently deleted c) A new stack is created d) The update process is paused indefinitely
Which resource type is most likely to require a stack policy for protection during updates? a) Amazon S3 buckets b) Amazon EC2 instances c) Elastic Load Balancers d) IAM roles
Answer Key
Qno
Answer (Option with Text)
1
b) To automate the creation and management of resources
2
a) Define the stack’s resources using a template
3
a) Modify the stack template and update the stack
4
a) The stack is automatically rolled back to its previous state
5
a) Parameters, resources, and outputs
6
a) AWS Lambda
7
a) CloudFormation StackSet
8
a) Only the resources created by CloudFormation
9
a) It allows managing CloudFormation stacks across multiple accounts and regions
10
a) It creates resources in a sequential order based on dependencies
11
a) To identify changes made to stack resources outside of CloudFormation
12
a) A set of updates to be applied to a stack
13
a) By identifying configuration drift and differences between the stack’s expected and actual state
14
a) By showing what changes will be made before applying them
15
a) By reviewing the changes in the AWS Management Console or AWS CLI
16
a) To visually design and modify CloudFormation templates
17
a) Visual diagram editor
18
a) By providing drag-and-drop functionality for resource creation
19
a) It checks for syntax errors in the CloudFormation template
20
a) JSON and YAML
21
a) To define which resources are protected from changes during stack updates
22
a) When an error occurs during stack creation or update
23
a) By using stack policies to prevent changes to certain resources
24
a) CloudFormation restores the stack to its previous state