Skip to content

Commit 7b14283

Browse files
authored
Fix aws bucket creation failure on us-east-1 (#455)
1 parent 3fa92f3 commit 7b14283

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

task/aws/resources/resource_bucket.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ type Bucket struct {
2929

3030
func (b *Bucket) Create(ctx context.Context) error {
3131
createInput := s3.CreateBucketInput{
32-
Bucket: aws.String(b.Identifier),
33-
CreateBucketConfiguration: &types.CreateBucketConfiguration{
34-
LocationConstraint: types.BucketLocationConstraint(b.Client.Region),
35-
},
32+
Bucket: aws.String(b.Identifier),
33+
CreateBucketConfiguration: &types.CreateBucketConfiguration{},
34+
}
35+
36+
if b.Client.Region != "us-east-1" {
37+
createInput.CreateBucketConfiguration.LocationConstraint = types.BucketLocationConstraint(b.Client.Region)
3638
}
3739

3840
if _, err := b.Client.Services.S3.CreateBucket(ctx, &createInput); err != nil {

0 commit comments

Comments
 (0)