Skip to content

Commit

Permalink
Adding aws s3 bucket lifecycle configuration to the repo (#1972)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolyncole authored Oct 18, 2024
1 parent 40e8baa commit 5327f4e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
14 changes: 14 additions & 0 deletions s3-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# AWS configuration

## Lifecycle rules
S3 lifecycle rules help to keep the S3 buckets free from cruft, from files that have been deleted, many versions of files, and old log files. The files in this directory can be applied to S3 using the aws command line client. The files are specific for staging and production data storage and log file storage.

```
aws s3api put-bucket-lifecycle-configuration --bucket <bucket name> --lifecycle-configuration file://<file for bucket>.json
```

You can check what rules are already applied to a bucket running

```
aws s3api get-bucket-lifecycle-configuration --bucket <bucket name>
```
12 changes: 12 additions & 0 deletions s3-config/logs-lifecycle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Rules": [
{
"Expiration": {
"Days": 60
},
"ID": "delete old logs",
"Filter": {},
"Status": "Enabled"
}
]
}
18 changes: 18 additions & 0 deletions s3-config/prod-lifecycle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Rules": [
{
"Expiration": {
"ExpiredObjectDeleteMarker": true
},
"ID": "Remove old deleted versions",
"Filter": {},
"Status": "Enabled",
"NoncurrentVersionExpiration": {
"NoncurrentDays": 30
},
"AbortIncompleteMultipartUpload": {
"DaysAfterInitiation": 14
}
}
]
}
18 changes: 18 additions & 0 deletions s3-config/staging-lifecycle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Rules": [
{
"Expiration": {
"ExpiredObjectDeleteMarker": true
},
"ID": "Remove old deleted versions",
"Filter": {},
"Status": "Enabled",
"NoncurrentVersionExpiration": {
"NoncurrentDays": 30
},
"AbortIncompleteMultipartUpload": {
"DaysAfterInitiation": 14
}
}
]
}

0 comments on commit 5327f4e

Please sign in to comment.