Reputation: 1688
I would like the the "Access" column in the web console bucket list to read "not public" for each bucket.
Upvotes: 1
Views: 254
Reputation: 1688
for BUCKET_NAME in $(aws s3 --profile YOUR_PROFILE_HERE ls s3:// | cut -d' ' -f3); do aws s3api --profile YOUR_PROFILE_HERE put-public-access-block --bucket "$BUCKET_NAME" --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"; done;
Upvotes: 1