100 Days of DevOps — Day 25-AWS S3 Bucket using Terraform
Welcome to Day 24 of 100 Days of DevOps, Let continue our journey with terraform and see how to use terraform with S3 bucket.
What is AWS S3?
AWS Simple Storage Service(S3) provides secure, durable and highly scalable object storage. S3 is easy to use and we can store and retrieve any amount of data from anywhere on the web.
Let’s create S3 bucket using terraform
bucket: name of the bucket, if we ommit that terraform will assign random bucket name
acl: Default to Private(other options public-read and public-read-write)
versioning: Versioning automatically keeps up with different versions of the same object.
NOTE: Every S3 bucket must be unique and that why random id is useful to prevent our bucket to collide with others.
LifeCycle Management
Why do we need LifeCycle Management?
- To save cost
- In most of the cases, data which is generated by our application is relevant for us for the first 30 days and after that, we don’t access that data as frequently.
Reference:
LifeCycle object supports the following but I am going to enable just the required parameters
- enabled — (Required) Specifies lifecycle rule status.
transition
- (Optional) Specifies a period in the object's transitions
- Here I am defining after 30 days move the objects to STANDARD_IA and after 60 days to GLACIER.
GitHub Link
Looking forward from you guys to join this journey and spend a minimum an hour every day for the next 100 days on DevOps work and post your progress using any of the below medium.
- Twitter: @100daysofdevops OR @lakhera2015
- Facebook: https://www.facebook.com/groups/795382630808645/
- Medium: https://medium.com/@devopslearning
- Slack: https://devops-myworld.slack.com/messages/CF41EFG49/
- GitHub Link:https://github.com/100daysofdevops
Reference