-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
In the script create_cfn_stack.py the create_bucket function fails for certain regions with the following error:
A client error (IllegalLocationConstraintException) occurred when calling the CreateBucket operation: The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.
Upon searching a bit I landed on this issue aws/aws-cli#2603
For now I have mitigated the issue by modifying the code for my region and adding the LocationConstraint
def create_bucket(bucket_name):
"""Create an S3 bucket in a specified region
:param bucket_name: Bucket to create
:return: True if bucket created, else False
"""
try:
s3_client.create_bucket(
Bucket=bucket_name,
CreateBucketConfiguration={'LocationConstraint': 'ap-southeast-1'}
)
logging.info(f'New bucket name: {bucket_name}')
except ClientError as e:
logging.info('An error occurred !!', bucket_name)
logging.error(e)
return False
return True
However I think the script can be modified to accommodate for this so it doesn't fail.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels