Skip to content

Commit 337ef7c

Browse files
committed
Improve comment about US-EAST-1 fix
1 parent b719bfc commit 337ef7c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

cloud/aws/aws_s3.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,20 @@ Status S3StorageProvider::CreateBucket(const std::string& bucket) {
481481
Aws::S3::Model::BucketLocationConstraint bucket_location = Aws::S3::Model::
482482
BucketLocationConstraintMapper::GetBucketLocationConstraintForName(
483483
ToAwsString(env_->GetCloudEnvOptions().dest_bucket.GetRegion()));
484-
// to create a bucket in US-EAST-1 you must specify no constraint location for
485-
// legacy reasons
484+
//
485+
// If you create a bucket in US-EAST-1, no location constraint should be
486+
// specified
487+
//
488+
// https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html
489+
//
490+
// By default, the bucket is created in the US East (N. Virginia) Region.
491+
// You can optionally specify a Region in the request body. You might choose
492+
// a Region to optimize latency, minimize costs, or address regulatory
493+
// requirements.
494+
//
486495
if ((bucket_location != Aws::S3::Model::BucketLocationConstraint::NOT_SET) &&
487496
(bucket_location !=
488497
Aws::S3::Model::BucketLocationConstraint::us_east_1)) {
489-
// only set the location constraint if it's not not set
490498
conf.SetLocationConstraint(bucket_location);
491499
}
492500

0 commit comments

Comments
 (0)