Skip to content

Commit

Permalink
region fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ljacobsson committed Nov 23, 2022
1 parent f2c6b6b commit 3d8c86d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/code-binding/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ program
.option("-n, --type-name [typeName]", "Type name", "MyType")
.option("-p, --profile [profile]", "AWS profile to use")
.option(
"--region [region]",
"-r, --region [region]",
"The AWS region to use. Falls back on AWS_REGION environment variable if not specified"
)
.option(
Expand Down
2 changes: 1 addition & 1 deletion src/commands/shared/auth-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require("@mhlabs/aws-sdk-sso");

function initAuth(cmd) {

AWS.config.region = cmd.region || process.env.AWS_REGION || AWS.config.region
const credentials = new AWS.SharedIniFileCredentials({ profile: cmd.profile });
if (credentials.accessKeyId) {
AWS.config.credentials = credentials;
Expand All @@ -12,7 +13,6 @@ function initAuth(cmd) {
new AWS.SingleSignOnCredentials()
);
}
process.env.AWS_REGION = cmd.region || process.env.AWS_REGION || AWS.config.region
}

module.exports = {
Expand Down

0 comments on commit 3d8c86d

Please sign in to comment.