s3 storage class
- storage class will based on file accessing and pricing
- to manage storage class with s3 lifecycle
- Standard :
- general purpose used for frequently access file
- millisecond to access the file
- webapp, mobile apps, daily used files and automation scrpits …etc
- s3 Intelligent-Tiering:
- automatically change storage class based on access the file.
- millisecond to access the file
- Standard-IA
- access the once in a month
- replicas >= 3
- after 30 days only you can change storage class
- One Zone-IA
- access the once in a month
- back will be one zone
- after 30 days only you can change storage class
- Glacier Instant Retrieval
- Long-lived archive data accessed once a quarter with instant retrieval in milliseconds
- replicas will >=3
- used for once in a 90 days
- archevied
- after 90 days only you can change storage class
- Glacier Flexible Retrieval (formerly Glacier)
- Long-lived archive data accessed once a year with retrieval of minutes to hours
- after 90 days only you can change storage class
- Glacier Deep Archive
- Long-lived archive data accessed less than once a year with retrieval of hours
- cost of storage is very less compare with other storage class
- retrieval will up to 12 hours to access file based on file sizes
- after 180 days only you can change storage class
aws s3api put-bucket-lifecycle-configuration \
--bucket <bucket-name> \
--lifecycle-configuration file://lifecycle.json
{
"Rules": [
{
"ID": "Delete-old-versions",
"Status": "Enabled",
"NoncurrentVersionExpiration": {
"NoncurrentDays": 5
}
},
{
"ID": "Delete-current-objects",
"Status": "Enabled",
"Expiration": {
"Days": 365
}
}
]
}
Task:
- create s3 bucket and enable versioning
- create lifecycle rule change object store class
- after 30 days Standard-IA
- after 60 days Glacier Instant
- ater 180 days Glacier Deep Archive