Last active
June 26, 2020 15:03
-
-
Save raykrueger/d267824e3a5c50d209aabca3edfaf254 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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