Sign inSign up free

1112. Bring a Hand-Made Bucket Under OpenTofu

medium 20 XP ~12 minHands-on lab

The bucket auth-api-assets was created by hand in the console months ago, with versioning on. The team has since written its OpenTofu config in ~/infra/auth-api, but tofu apply there fails, because the bucket already exists and isn't in the state.

Task

  • The OpenTofu state in ~/infra/auth-api manages the existing bucket and its versioning setting (aws_s3_bucket.assets, aws_s3_bucket_versioning.assets).
  • tofu plan there reports no changes.
  • The bucket is the same one: its files are still there.

This machine has an AWS-style account (an emulator: nothing is billed). tofu and the aws CLI are both signed in as the account's administrator.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Part of AWS Hands-On. Next step: A Rename That Would Delete the Logs Bucket

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.