Fix extra734 - handle us-east-1

(cherry picked from commit 5f2eb7f82e3814478b380ae5fbb6c8a69536e043)
This commit is contained in:
Nimrod Kor
2020-06-04 23:08:58 +03:00
parent 99d1de8c15
commit ef4d2d33be

View File

@@ -27,6 +27,12 @@ extra734(){
# OR
# - Have bucket policy denying s3:PutObject when s3:x-amz-server-side-encryption is absent
if [[ $BUCKET_LOCATION == "None" ]]; then
BUCKET_LOCATION="us-east-1"
fi
if [[ $BUCKET_LOCATION == "EU" ]]; then
BUCKET_LOCATION="eu-west-1"
fi
# query to get if has encryption enabled or not
RESULT=$($AWSCLI s3api get-bucket-encryption $PROFILE_OPT --region $BUCKET_LOCATION --bucket $bucket --query ServerSideEncryptionConfiguration.Rules[].ApplyServerSideEncryptionByDefault[].SSEAlgorithm --output text 2>&1)
if [[ $(echo "$RESULT" | grep AccessDenied) ]]; then