Skip to content

Instantly share code, notes, and snippets.

@dsalazar-carecloud
Last active October 26, 2018 21:31
Show Gist options
  • Save dsalazar-carecloud/8cbf34b9311355c6dd734696877292f6 to your computer and use it in GitHub Desktop.
Save dsalazar-carecloud/8cbf34b9311355c6dd734696877292f6 to your computer and use it in GitHub Desktop.
S3 Bucket Lifecycle Configuration (AWS CLI s3api cmd)
# AWS CLI required.
# s3api: http://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-lifecycle-configuration.html
aws s3api put-bucket-lifecycle-configuration --bucket <bucket-name> --lifecycle-configuration file://<path-to-policy-json>
# Policy file example
# {
# "Rules": [
# {
# "ID": "Expires in 120 DAYS",
# "Prefix": "",
# "Status": "Enabled",
# "Expiration": {
# "Days": 120
# }
# }
# ]
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment