Skip to content

Commit 67fd278

Browse files
author
Chase Coalwell
authored
fix: no LocationConstraint for us-east-1 (#844)
1 parent 7865151 commit 67fd278

File tree

1 file changed

+7
-7
lines changed
  • packages/middleware-location-constraint/src

1 file changed

+7
-7
lines changed

Diff for: packages/middleware-location-constraint/src/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ export function locationConstraintMiddleware(
2626
const { CreateBucketConfiguration } = args.input;
2727
//After region config resolution, region is a Provider<string>
2828
const region = await options.region();
29-
if (
30-
!CreateBucketConfiguration ||
31-
!CreateBucketConfiguration.LocationConstraint
32-
) {
29+
if (region === "us-east-1") {
3330
args = {
3431
...args,
3532
input: {
3633
...args.input,
37-
CreateBucketConfiguration: { LocationConstraint: region }
34+
CreateBucketConfiguration: undefined
3835
}
3936
};
40-
} else if (region === "us-east-1") {
37+
} else if (
38+
!CreateBucketConfiguration ||
39+
!CreateBucketConfiguration.LocationConstraint
40+
) {
4141
args = {
4242
...args,
4343
input: {
4444
...args.input,
45-
CreateBucketConfiguration: undefined
45+
CreateBucketConfiguration: { LocationConstraint: region }
4646
}
4747
};
4848
}

0 commit comments

Comments
 (0)