Skip to content

Commit

Permalink
Fix aws bucket creation failure on us-east-1
Browse files Browse the repository at this point in the history
Closes #454; see the issue for context.
  • Loading branch information
0x2b3bfa0 authored Mar 23, 2022
1 parent d5c4d1e commit c547a38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions task/aws/resources/resource_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ type Bucket struct {
func (b *Bucket) Create(ctx context.Context) error {
createInput := s3.CreateBucketInput{
Bucket: aws.String(b.Identifier),
CreateBucketConfiguration: &types.CreateBucketConfiguration{
LocationConstraint: types.BucketLocationConstraint(b.Client.Region),
},
CreateBucketConfiguration: &types.CreateBucketConfiguration{},
}

if b.Client.Region != "us-east-1" {
createInput.CreateBucketConfiguration.LocationConstraint = types.BucketLocationConstraint(b.Client.Region)
}

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

0 comments on commit c547a38

Please sign in to comment.