Skip to main content
In this lesson you’ll create a simple AWS CloudFormation stack that provisions an Amazon S3 bucket, then update that stack to add tags. A CloudFormation stack is a collection of AWS resources you create and manage together from a template — effectively a group of resources managed as one unit. This guide walks through:
  • authoring a minimal CloudFormation YAML template,
  • uploading the template to the AWS Management Console,
  • creating the stack,
  • updating the stack to add metadata (tags),
  • and verifying the result in the S3 console.

What you’ll create

  • A CloudFormation stack named (for example) DemoStack
  • One S3 bucket resource with logical ID MyBucket
  • An update that adds an Author: Arno tag to the bucket

Prerequisites

  • An AWS account and permissions to create CloudFormation stacks and S3 buckets.
  • A code editor (Visual Studio Code recommended).

Step 1 — Open CloudFormation in the Console

Open the AWS Management Console, use the service search box, type “CloudFormation” (typing “CloudF” is sufficient), and select CloudFormation. If you’ve used CloudFormation before you’ll land on the Stacks dashboard; otherwise you’ll see the CloudFormation homepage. Click “Create stack” and follow the guided steps:
  1. Create stack
  2. Specify stack details
  3. Configure stack options
  4. Review and create
Templates can come from multiple sources. A short reference of common choices: For this lesson we’ll create a local YAML template and upload it directly via the console.

Step 2 — Create stack.yaml locally

Open your project folder in Visual Studio Code and create a new file named stack.yaml. Example Windows path:
A dark-themed Visual Studio Code window with the Explorer open and a file named "stack.yaml" selected. The editor shows the "stack.yaml" tab with a single line containing the number "1".
Start the template with the required version header and a single Resources section declaring an S3 bucket with logical ID MyBucket:
Save stack.yaml.

Step 3 — Upload the template and create the stack

In the CloudFormation console choose “Upload a template file”, select the stack.yaml you created, then click Next and proceed through the stack creation wizard. CloudFormation will internally upload your template (it stores it in a managed S3 location) and then create the stack.
A screenshot of the AWS CloudFormation "Create stack" page showing the "Upload a template file" panel with "stack.yaml" selected and an S3 URL displayed, plus the Next and Cancel buttons.
Submit the create request. On the stack details page open the Events tab to follow progress. Initially the bucket creation will show CREATE_IN_PROGRESS and then CREATE_COMPLETE.
A screenshot of the AWS CloudFormation console showing the "DemoStack" events list with operation IDs, timestamps, and logical IDs like "MyBucket" and "DemoStack." Several resources are marked "CREATE_IN_PROGRESS."

Step 4 — Verify the S3 bucket

When the stack completes, open the Amazon S3 service in a new console tab and browse buckets. CloudFormation typically prefixes the physical bucket name with the stack name and logical ID; for example demostack-mybucket-<random-suffix>.
A screenshot of the Amazon S3 web console showing the bucket "demostack-mybucket-uhiv0vbctobm" with the Objects tab open. Visible controls include Upload, Create folder, Copy URL, and navigation links for Buckets and other S3 sections.

Step 5 — Update the stack to add tags

Tags are key-value pairs used to store metadata such as author, environment, or cost center. We’ll update the template to add an Author tag for the bucket.
YAML indentation is significant. Use consistent spaces (commonly two spaces per level). Under a resource’s Properties, Tags is a list where each item is a Key/Value mapping.
Edit stack.yaml and add a Properties block with Tags. The updated template should look like this:
Save the file. In the CloudFormation console select your stack, then choose “Update stack”. Choose “Replace current template”, upload the updated stack.yaml, and proceed through the update wizard. Submit the change. Watch the Events pane to follow the update operation — you should see UPDATE_IN_PROGRESS followed by UPDATE_COMPLETE entries for the stack and the MyBucket resource.
A screenshot of the AWS CloudFormation console showing the Events pane for a stack called "DemoStack," listing operation IDs, timestamps and resources (e.g., MyBucket) with statuses like UPDATE_IN_PROGRESS. The browser header shows the CloudWithDjango-Org account and standard AWS navigation controls.

Step 6 — Confirm the update

When the update completes the stack status will show UPDATE_COMPLETE. Verify the S3 bucket’s properties in the S3 console (Properties → Tags) to confirm the Author: Arno tag appears.
A screenshot of the AWS CloudFormation console listing one stack named "DemoStack" with status "UPDATE_COMPLETE" and a creation timestamp. The page shows CloudFormation controls (Delete/Update/Create stack) and the AWS account/region header.

Troubleshooting tips

  • If the stack update fails, check the Events tab for the failing resource and the associated error message.
  • Ensure the IAM permissions for your user/role include CloudFormation and S3 actions required for stack creation and updates.
  • Verify there are no bucket name conflicts; CloudFormation-generated physical names include a random suffix to help avoid collisions.
That’s it — you created a CloudFormation stack, added an S3 bucket, and updated the stack to attach tags. Well done.

Watch Video

Practice Lab