0
0
AWScloud~30 mins

S3 versioning in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Enable and Configure S3 Versioning
📖 Scenario: You are managing a cloud storage bucket for a small company. To protect against accidental file deletions or overwrites, you want to enable versioning on the bucket. This way, every change to a file is saved as a new version, allowing recovery if needed.
🎯 Goal: Create an AWS S3 bucket with versioning enabled using infrastructure as code. You will first define the bucket, then add a versioning configuration, and finally complete the setup to ensure versioning is active.
📋 What You'll Learn
Create an S3 bucket named exactly my-versioned-bucket
Add a versioning configuration block with status set to Enabled
Ensure the final configuration is valid and deployable
💡 Why This Matters
🌍 Real World
Versioning in S3 helps protect important files from accidental deletion or overwrites by keeping multiple versions of each object.
💼 Career
Cloud engineers and DevOps professionals often configure S3 versioning to ensure data durability and recovery options in production environments.
Progress0 / 4 steps
1
Create the S3 bucket resource
Write the Terraform code to create an AWS S3 bucket resource named my-versioned-bucket using the resource name aws_s3_bucket.my_versioned_bucket.
AWS
Need a hint?

Use the resource block with type aws_s3_bucket and name my_versioned_bucket. Set the bucket attribute to "my-versioned-bucket".

2
Add versioning configuration block
Add a versioning block inside the aws_s3_bucket.my_versioned_bucket resource. Set the enabled attribute to true to enable versioning.
AWS
Need a hint?

Inside the bucket resource, add a versioning block with enabled = true to turn on versioning.

3
Add MFA delete configuration (optional security feature)
Add the mfa_delete attribute inside the versioning block and set it to false. This disables MFA delete for simplicity in this project.
AWS
Need a hint?

Inside the versioning block, add mfa_delete = false to explicitly disable MFA delete.

4
Complete the S3 bucket versioning configuration
Ensure the full Terraform resource aws_s3_bucket.my_versioned_bucket includes the bucket name my-versioned-bucket and the versioning block with enabled = true and mfa_delete = false.
AWS
Need a hint?

Review the entire resource block to confirm all required attributes are present and correctly set.