Skip to content

Commit a7e411b

Browse files
Merge pull request #104 from pluralsh/aws-s3-bucket-constraint
AWS: don't set bucket constraint for us-east-1
2 parents 74360b1 + a210569 commit a7e411b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

pkg/provider/aws.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,18 @@ func (p *AWSProvider) mkBucket(name string) error {
169169
_, err := client.HeadBucket(*p.goContext, &s3.HeadBucketInput{Bucket: &name})
170170

171171
if err != nil {
172-
_, err = client.CreateBucket(*p.goContext,
173-
&s3.CreateBucketInput{
174-
Bucket: &name,
175-
CreateBucketConfiguration: &s3Types.CreateBucketConfiguration{
176-
LocationConstraint: s3Types.BucketLocationConstraint(p.Region()),
177-
},
178-
},
179-
)
172+
173+
bucket := &s3.CreateBucketInput{
174+
Bucket: &name,
175+
}
176+
177+
if p.Region() != "us-east-1" {
178+
bucket.CreateBucketConfiguration = &s3Types.CreateBucketConfiguration{
179+
LocationConstraint: s3Types.BucketLocationConstraint(p.Region()),
180+
}
181+
}
182+
183+
_, err = client.CreateBucket(*p.goContext, bucket)
180184
return err
181185
}
182186

0 commit comments

Comments
 (0)