Skip to main content
In this walkthrough you’ll create, deploy, and update a simple AWS CloudFormation stack that provisions an S3 bucket. This step-by-step guide covers:
  • Preparing a CloudFormation template (YAML)
  • Creating a stack from the AWS Console
  • Updating the stack to add tags
  • Verifying the created resources
What is a CloudFormation stack? A CloudFormation stack is a collection of AWS resources you create and manage as a single unit using a template. The template defines the resources and their configuration. For this demo we will deploy one resource: an S3 bucket. Get started: open CloudFormation in the AWS Console
  1. Sign in to the AWS Console.
  2. Use the search bar to find and open CloudFormation (type “CloudF…” and select CloudFormation).
A screenshot of the AWS CloudFormation "Stacks" console showing "Stacks (0)" and a message "No stacks to display." The page shows a search box, filter controls, and action buttons like Create stack, Update stack, and Delete stack.
Click Create stack. The console guides you through four steps: Prepare template, Specify stack details, Configure stack options, and Review and create. You can author a template directly, use the Infrastructure Composer, or upload a local template file. For this guide we’ll upload a YAML file.
A browser screenshot of the AWS CloudFormation "Create stack" page showing the "Prerequisite - Prepare template" section with options to choose an existing template or build from the Infrastructure Composer. The left sidebar lists stack creation steps (Specify stack details, Configure stack options, Review and create).
Create the YAML template
  • Open your editor (Visual Studio Code recommended).
  • Create a new folder for the project (for example: C:\Users\Arno\Desktop\Project\).
  • Add a file named stack.yaml.
This template is the blueprint CloudFormation uses to create resources. For this example, save the following minimal template as stack.yaml:
YAML is indentation-sensitive. Use consistent spaces (not tabs) and ensure nested keys are indented properly. If you omit the BucketName property, CloudFormation will create a unique physical name for the bucket (usually combining the stack name, logical ID, and a random suffix).
Upload the template and create the stack
  1. In CloudFormation click Create stack → With new resources (standard).
  2. Under “Specify template” choose Upload a template file → Choose file → select your stack.yaml.
  3. Click Next, provide a Stack name (for example DemoStack), leave options as default, and complete the stack creation.
When you upload a template through the console, CloudFormation stores a copy of the template in a service-managed S3 location automatically.
A screenshot of the AWS CloudFormation "Create stack" console showing an uploaded template file named "stack.yaml" (with its S3 URL) and the "Next" button.
Monitor stack creation events Watch the Events tab of your stack while resources are created. You should see CREATE_IN_PROGRESS events for the stack and for the MyBucket resource. Wait until the stack status becomes CREATE_COMPLETE.
A screenshot of the AWS CloudFormation console showing the "DemoStack" events table with operation IDs, timestamps and resource logical IDs (e.g., MyBucket, DemoStack). Several entries show the status "CREATE_IN_PROGRESS."
Confirm the S3 bucket exists
  • Open the S3 console (search for S3).
  • Look for a bucket whose name is derived from the stack (for example demostack-mybucket-<random-suffix>). CloudFormation often prefixes the generated physical name with the stack name and logical ID.
A screenshot of the AWS Management Console showing an Amazon S3 bucket page for "demostack-mybucket-uhiv0vbctobm" with the Objects tab selected. The bucket shows zero objects and displays controls like Upload, Create folder, Copy URL and Actions.
Back in CloudFormation you should see your stack with status CREATE_COMPLETE.
A screenshot of the AWS CloudFormation Stacks page showing one stack named "DemoStack." The stack status is "CREATE_COMPLETE" with a creation timestamp.
Update the stack: add tags to the S3 bucket Tags are key/value pairs that help you identify and organize resources (for example: Author, Environment, CostCenter). To add a tag to the bucket, update stack.yaml by adding Properties with Tags under the MyBucket resource:
Save the updated file. Perform the stack update in the CloudFormation console
  1. Select the DemoStack stack and click Update.
  2. Choose “Replace current template” → Upload a template file → select the updated stack.yaml.
  3. Click Next, review the change set or options, and submit the update.
Monitor the update events: you’ll see UPDATE_IN_PROGRESS entries for the stack and the MyBucket resource. Wait until the update completes.
A screenshot of the AWS CloudFormation console showing the "DemoStack" Events page with operation IDs, timestamps, logical IDs (e.g., MyBucket, DemoStack) and several "UPDATE_IN_PROGRESS" event statuses. The browser toolbar and AWS account/region header are visible at the top.
Verify the tag was applied
  • Open the S3 console and select the bucket.
  • In the bucket Properties view, scroll to Tags. You should see the tag Author: Arno.
Summary of what you created Next steps and references
  • To manage infrastructure as code at scale, explore AWS CloudFormation features such as Parameters, Outputs, Mappings, and Conditions.
  • Learn more in the official AWS docs: AWS CloudFormation Documentation.
  • If you prefer infrastructure as code with different tooling, consider Terraform: Terraform Registry.
That’s it — you’ve successfully created and updated your first CloudFormation stack. Well done!

Watch Video

Practice Lab