Created
April 11, 2023 14:37
-
-
Save jharrington22/91a13d0a827540ea04cd32d58b7d8d4b to your computer and use it in GitHub Desktop.
Create bucket and ACL in all regions
This file contains 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 | |
REGIONS=$( aws ec2 describe-regions --region us-east-1 | jq -r '.Regions[] | select(.OptInStatus=="opt-in-not-required").RegionName' ) | |
for region in ${REGIONS[*]} | |
do | |
echo $region | |
BUCKET_NAME="test-bucket-acl-$RANDOM" | |
echo "Bucket name: $BUCKET_NAME region: $region" | |
aws s3api create-bucket --bucket "test-acl-bucket-$RANDOM" --region "$region" --acl private --create-bucket-configuration LocationConstraint="$region" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment