Skip to content

Instantly share code, notes, and snippets.

@allenmichael
Created January 28, 2020 19:01
Show Gist options
  • Save allenmichael/5fe0ca15f14b50ab1507f6186efd7b04 to your computer and use it in GitHub Desktop.
Save allenmichael/5fe0ca15f14b50ab1507f6186efd7b04 to your computer and use it in GitHub Desktop.
aws s3api list-buckets --query "Buckets[].Name" --output text | \
xargs -n1 -I{} sh -c 'aws s3api get-bucket-location --bucket {} --output text | xargs -n1 -I@ echo {} @' | \
xargs -n2 sh -c 'if [ $1 == "None" ]; then echo $0 - us-east-1 ; else echo $0 - $1 ; fi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment