Understanding S3 Lifecycle Policies
An S3 lifecycle policies configuration is
- a set of rules that define actions
- Rules is applied to group of objects in S3.
- an XML file, comprises a set of rules with predefined actions
- S3 provides a set of API operations for managing lifecycle configuration on a bucket.
- S3 stores configuration as a lifecycle subresource that is attached to bucket.
- Configure lifecycle by
- Amazon S3 console
- AWS SDK wrapper libraries
- two types of actions:
- Transition actions—Define when objects transition to another storage class.
- Expiration actions—Define when objects expire. Amazon S3 deletes expired objects on behalf.
S3 Lifecycle Policies supports following lifecycle transitions between storage classes using a lifecycle configuration:
- transition from STANDARD storage class to any other storage class.
- transition from any storage class to GLACIER or DEEP_ARCHIVE storage classes.
- And, transition from STANDARD_IA storage class to INTELLIGENT_TIERING or ONEZONE_IA storage classes.
- transition from INTELLIGENT_TIERING storage class to ONEZONE_IA storage class.
- transition from GLACIER storage class to DEEP_ARCHIVE storage class.
Storage class transitions have following constraints:
- From STANDARD or STANDARD_IA storage class to INTELLIGENT_TIERING. following constraints apply:
- For larger objects, there is a cost benefit for transitioning to INTELLIGENT_TIERING. Amazon S3 does not transition objects that are smaller than 128 KB to INTELLIGENT_TIERING storage class because it’s not cost effective.
- From STANDARD storage classes to STANDARD_IA or ONEZONE_IA. following constraints apply:
- For larger objects, there is a cost benefit for transitioning to STANDARD_IA or ONEZONE_IA. Amazon S3 does not transition objects that are smaller than 128 KB to STANDARD_IA or ONEZONE_IA storage classes because it’s not cost effective.
- Objects must store for at least 30 days in current storage class before you can transition them to STANDARD_IA or ONEZONE_IA. For example, you cannot create a lifecycle rule to transition objects to STANDARD_IA storage class one day after you create them.
- Amazon S3 doesn’t transition objects within first 30 days because newer objects often access more frequently or deleted sooner than is suitable for STANDARD_IA or ONEZONE_IA storage.
- If you are transitioning noncurrent objects (in versioned buckets), you can transition only objects that are at least 30 days noncurrent to STANDARD_IA or ONEZONE_IA storage.
- From STANDARD_IA storage class to ONEZONE_IA. following constraints apply:
- Objects must stored for at least 30 days in STANDARD_IA storage class before you can transition them to ONEZONE_IA class.
Various metadata associated in XML, are
- LifecycleConfiguration – It defines a rule that applies to an object with a key.
- ID– ID element uniquely identifies a rule. A lifecycle configuration can have up to 1000 rules.
- Prefix – Prefix are Object keys.
- Status – Enabled or Disabled.
- Transition – It is one of lifecycle actions of S3, specifying movement objects to another storage class.
- Expiration – It specifies when objects expire.
- In a non-versioned bucket, expiration permanently removes object.
- In a versioned bucket, S3 will not take any action if there are one or more object versions and delete marker is current version.
- It applies only to current version.
- Preparing for AWS Certified Solutions Architect Associate, try hundreds of practice tests with expert guidance. Take Test Now!
AWS Certified Solutions Architect Associate Free Practice TestTake a Quiz