Created
October 2, 2019 21:31
-
-
Save djmetzle/c46ac38a9357d2ee624e1a6c7dbce108 to your computer and use it in GitHub Desktop.
List which S3 buckets have logging enabled
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
#!/bin/bash -e | |
S3_BUCKETS=( `aws s3api list-buckets --query "Buckets[].Name" --output=text` ) | |
for bucket in "${S3_BUCKETS[@]}"; do | |
BUCKET_LOGGING=`aws s3api get-bucket-logging --bucket $bucket` | |
if [ -n "$BUCKET_LOGGING" ]; then | |
echo "$bucket: $BUCKET_LOGGING" | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment