Stacks
A stack is a group of related resources provisioned by AWS CloudFormation based on the provided template. When you create, update, or delete a stack, CloudFormation automatically manages all the resources defined in the template file. Stacks can be created, updated, and deleted from templates uploaded to an S3 bucket, or directly from the AWS Management Console using the provided templates. Stack management becomes essential in efficiently deploying and maintaining complex, multi-tier applications and infrastructure in a group.
Guide to AWS CloudFormation Stacks
AWS CloudFormation Stacks are a collection of AWS resources that you can manage as a single unit. They are important as they enable you to model your infrastructure and application resources with text files.
How it Works:
In AWS CloudFormation, you create, manage, and update a collection of resources by creating and updating stacks. AWS CloudFormation creates and deletes all member resources of the stack together and manages all resources in the stack as a single unit. AWS CloudFormation uses the AWS Management Console, AWS CLI, or SDKs.
Exam Tips: Answering Questions on Stacks:
When confronted with a question about stacks on the exam, remember:
1. Stacks are the basic unit of deployment in AWS CloudFormation.
2. Stacks are operated on as a singular unit and share lifecycle; when a stack is deleted, all resources within are also deleted.
3. AWS CloudFormation templates define the resources needed for your applications. Knowing how to read and understand these templates will be crucial for answering exam questions.
4. AWS StackSets lets you create stacks across accounts and regions, and understanding the nuances of this is important for the exam.
AWS Certified Solutions Architect - Stacks Example Questions
Test your knowledge of Stacks
Question 1
Your company uses AWS CloudFormation to provision environments. You need to control what happens to a specific S3 bucket when its CloudFormation stack is deleted (for example, to retain the bucket instead of deleting it). Which resource attribute should you set?
Question 2
You plan to deploy an environment consisting of an EC2 instance and an RDS instance using AWS CloudFormation. The RDS instance must only be accessible to the EC2 instance in the same stack. What should you do?
Question 3
Your company has an existing cloudformation stack for deploying web applications. Your team wants to create a new stack to deploy a data processing application while keeping the resources organized. What is the best approach?