π AWS S3 Bucket Lifecycle Configuration is not enabled π’
- Contextual name: π Bucket Lifecycle Configuration is not enabled π’
- ID:
/ce/ca/aws/s3/bucket-lifecycle-configuration
- Located in: π AWS S3
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
COST
RELIABILITY
Similar Policiesβ
- AWS Trusted Advisor
- [c18d2gz100](Amazon S3 Bucket Lifecycle Policy Configured (https://docs.aws.amazon.com/awssupport/latest/user/cost-optimization-checks.html#amazon-s3-bucket-lifecycle-policy-configured)]
- Cloud Conformity
- Internal
dec-x-edc86d3d
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-edc86d3d | 1 |
Logicβ
- π§ prod.logic.yaml π’
- π AWS S3 Bucket
- π AWS S3 Bucket - object.extracts.yaml
- π§ͺ test-data.json
Descriptionβ
Descriptionβ
Configure Amazon S3 Lifecycle in order to ensure the automation of object lifecycle management, storage costs optimization, and compliance with data retention policies.
Rationalβ
An S3 Lifecycle configuration consists of rules that define actions to be taken on a group of objects. These actions include:
Transition Actions: Move objects to different storage classes as they age, helping to optimize costs without manual intervention.
Expiration Actions: Automatically delete objects that have reached the end of their lifecycle, ensuring compliance with data retention policies.
Impactβ
Organizations may accumulate outdated or irrelevant data, resulting in cluttered storage environments that are more difficult to manage and maintain. Without proper lifecycle policies, the storage of redundant or obsolete data can consume significant resources and escalate costs unnecessarily.
Auditβ
The object is marked as
INCOMPLIANT
if theLifecycle Rules JSON
field is empty or none of the Lifecycle rules inLifecycle Rules JSON
have"status": "Enabled"
.... see more
Remediationβ
Remediationβ
From Command Lineβ
To set an S3 Lifecycle configuration on a bucket using the AWS CLI, follow these steps:
Save a JSON Lifecycle configuration in a file
lifecycle.json
. Although the Amazon S3 Lifecycle configuration is an XML file, the AWS CLI requires the configuration to be specified in JSON format.Here's an example of an S3 Lifecycle Configuration in JSON format:
{
"Rules": [
{
"ID": "ExampleRule1",
"Filter": {
"Prefix": "documents/"
},
"Status": "Enabled",
"Transitions": [
{
"Days": 60,
"StorageClass": "INTELLIGENT_TIERING"
},
{
"Days": 120,
"StorageClass": "GLACIER"
}
],
"Expiration": {
"Days": 730
}
}
]
}In this example objects with the prefix
documents/
will transition to the Intelligent-Tiering storage class after 60 days, then to the Glacier storage class after 120 days. Finally, the objects will be automatically deleted after 730 days.
- Execute the following AWS CLI command to set the Lifecycle configuration on your S3 bucket. Replace
{{your--bucket-name}}
with the actual name of your S3 bucket:... see more