google / cloud-forensics-utils

Python library to carry out DFIR analysis on the Cloud
Apache License 2.0
464 stars 88 forks source link

Only provide a LocationConstraint when creating an S3 bucket if region != us-east-1 #305

Closed hiddenillusion closed 3 years ago

hiddenillusion commented 3 years ago

us-east-1 is the default region where the S3 bucket will get created if a LocationConstraint isn't provided.

However, there's an issue that causes the CreateBucket operation to fail if us-east-1 is explicitly placed as the LocationContraint:

Could not create bucket <BUCKET_NAME>t: An error occurred (InvalidLocationConstraint) when calling the CreateBucket operation: The specified location-constraint is not valid

S3.CreateBucket() should check what the values of region & self.aws_account.default_region are and skip adding the LocationConstraint if us-east-1 is provided

Fryyyyy commented 3 years ago

https://github.com/boto/boto3/issues/125 👌