Skip to content

Instantly share code, notes, and snippets.

@raykrueger
Last active June 26, 2020 15:03
Show Gist options
  • Save raykrueger/d267824e3a5c50d209aabca3edfaf254 to your computer and use it in GitHub Desktop.
Save raykrueger/d267824e3a5c50d209aabca3edfaf254 to your computer and use it in GitHub Desktop.
bucket=$(uuidgen)
aws s3 mb s3://${bucket}
cat > lifecycle.json <<EOF
{
"Rules": [
{
"Filter": {
"Prefix": ""
},
"Status": "Enabled",
"Expiration": {
"Days": 1
},
"ID": "KillThemAll"
}
]
}
EOF
aws s3api put-bucket-lifecycle-configuration --bucket ${bucket} --lifecycle-configuration file://lifecycle.json
echo Hello World > hello.txt
aws s3 cp hello.txt s3://${bucket}/
aws s3 presign s3://${bucket}/hello.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment