Created
September 23, 2022 02:43
-
-
Save pwmcintyre/16107640db8408d1b167307688965b78 to your computer and use it in GitHub Desktop.
list all buckets and their lifecycle rules
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
#! /usr/bin/env bash | |
# to make this blubage easier to read ... | |
WHITE="97" | |
BOLDWHITE="\e[1;${WHITE}m" | |
ENDCOLOR="\e[0m" | |
# list buckets and loop | |
aws s3api list-buckets --query 'Buckets[].[Name]' --output text | while read bucket ; do | |
echo "${BOLDWHITE}${bucket}${ENDCOLOR}" | |
aws s3api get-bucket-lifecycle-configuration --bucket $bucket | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment