Hands-on exercises “Cloud Storage”
Goal
Create the first cloud object-storage bucket and expose its provider-computed attributes. This exercise is provider-neutral: choose AWS, Azure, or GCP before starting and use the matching provider documentation and solution directory.
Preparation
- Choose one provider for the standard track and keep that provider for Hands-on 3 and 4.
- Authenticate with the provider’s CLI or environment variables before running Terraform.
- Check the matching example in AWS, Azure, or GCP.
- Read the provider’s bucket resource documentation before writing the resource. The relevant links are listed in Core Components.
The examples use a unique bucket name. Cloud object-storage names are often globally unique, so do not copy a shared example name unchanged.
Steps
- Search the selected provider’s bucket resource in the Terraform Registry.
- Add the provider requirement, provider configuration, and a variable for the project, account, or region values required by your provider.
- Write a root module with one object-storage bucket resource. Use a unique name and enable the provider’s recommended safety settings for a workshop resource.
- Add an output for the bucket name and at least one computed attribute, such as its region or self-link.
- Run
terraform fmt,terraform init,terraform validate, andterraform plan. - Apply after reviewing the plan, then run
terraform outputand verify the bucket in the provider console or CLI.
The success criterion is one bucket created by Terraform, a readable output, and a clean second plan. Do not configure remote state in this first exercise; bootstrap resources must exist before a remote backend can use them.