Skip to content

Commit

Permalink
fix: load region from AWS client if the credentials are managed by AW…
Browse files Browse the repository at this point in the history
…S-SDK
  • Loading branch information
Amplifiyer committed Feb 5, 2025
1 parent aab715d commit a7bcec4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ export class DeploymentManager {
): Promise<DeploymentManager> => {
try {
const cred = await loadConfiguration(context);
assert(cred.region);
return new DeploymentManager(cred, cred.region, deploymentBucket, eventMap, options);
// this is the "general" config level case, aws sdk will resolve creds and region from env variables etc.
const region = cred?.region ?? new aws.S3().config.region;
return new DeploymentManager(cred, region, deploymentBucket, eventMap, options);
} catch (e) {
throw new AmplifyError(
'DeploymentError',
Expand Down

0 comments on commit a7bcec4

Please sign in to comment.