Skip to content

Commit 9d1bb1a

Browse files
authored
Merge pull request #14097 from aws-amplify/V1664968988
fix: load region from AWS client if the credentials are managed by AWS-SDK
2 parents aab715d + a7bcec4 commit 9d1bb1a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/amplify-provider-awscloudformation/src/iterative-deployment/deployment-manager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ export class DeploymentManager {
8888
): Promise<DeploymentManager> => {
8989
try {
9090
const cred = await loadConfiguration(context);
91-
assert(cred.region);
92-
return new DeploymentManager(cred, cred.region, deploymentBucket, eventMap, options);
91+
// this is the "general" config level case, aws sdk will resolve creds and region from env variables etc.
92+
const region = cred?.region ?? new aws.S3().config.region;
93+
return new DeploymentManager(cred, region, deploymentBucket, eventMap, options);
9394
} catch (e) {
9495
throw new AmplifyError(
9596
'DeploymentError',

0 commit comments

Comments
 (0)