Hands-On Mini Lab
S3 Versioning and Lifecycle Lab
Negligible for tiny test objects if cleaned up. Lifecycle transitions and retained versions can create charges if left behind.
Goal
Reinforce Buckets and objects, Versioning, Lifecycle rules, Encryption, Cleanup discipline through a small, inspectable activity.
Concepts Reinforced
- Buckets and objects
- Versioning
- Lifecycle rules
- Encryption
- Cleanup discipline
Prerequisites
- AWS CLI configured
- Permission to create a test S3 bucket
Estimated Cost
Exact Steps
- Create a uniquely named bucket in one Region.
- Enable versioning on the bucket.
- Upload a small text object twice with different content.
- List object versions and observe that S3 retained both versions.
- Apply a lifecycle rule that expires noncurrent versions after a short test interval where allowed by your account policy.
aws s3api create-bucket --bucket djames-study-example-111122223333 --region us-east-1
aws s3api put-bucket-versioning --bucket djames-study-example-111122223333 --versioning-configuration Status=Enabled
aws s3 cp ./note.txt s3://djames-study-example-111122223333/note.txt
aws s3api list-object-versions --bucket djames-study-example-111122223333 --prefix note.txtVerification
- aws s3api list-object-versions returns more than one version for the same key.
- The lifecycle configuration is visible with get-bucket-lifecycle-configuration.
Cleanup Steps
- Delete all object versions and delete markers.
- Delete the bucket.
Sources and Review Metadata
This independent training application is not affiliated with or endorsed by Amazon Web Services. AWS, Amazon Web Services, and AWS certification names are trademarks of Amazon.com, Inc. or its affiliates.