Skip to content

Commit 15516e2

Browse files
Fix AWS API error on us-east-1 CreateBucket (#519)
* Fix AWS API error on us-east-1 CreateBucket * Restyled by gofmt Co-authored-by: Restyled.io <commits@restyled.io>
1 parent e453ea7 commit 15516e2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

task/aws/resources/resource_bucket.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ 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{},
32+
Bucket: aws.String(b.Identifier),
3433
}
3534

3635
if b.Client.Region != "us-east-1" {
37-
createInput.CreateBucketConfiguration.LocationConstraint = types.BucketLocationConstraint(b.Client.Region)
36+
createInput.CreateBucketConfiguration = &types.CreateBucketConfiguration{
37+
LocationConstraint: types.BucketLocationConstraint(b.Client.Region),
38+
}
3839
}
3940

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

0 commit comments

Comments
 (0)