Skip to content

Commit

Permalink
fix: pass value instead of function in the if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Jan 18, 2024
1 parent 9ff21b4 commit 5608424
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/cwp-template-aws/cli/aws/checkCredentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
// Check if AWS credentials are configured
const sts = new STS();
const config = sts.config;
const region = await config.region();

try {
await sts.getCallerIdentity({});
Expand All @@ -27,7 +28,7 @@ module.exports = {
process.exit(1);
}

if (!config.region) {
if (!region) {
console.log();
context.error("You must define an AWS Region to deploy to!");
context.info(
Expand All @@ -40,8 +41,6 @@ module.exports = {
process.exit(1);
}

const region = await config.region();

// We assign the region to the appropriate ENV variable for easier access in the stack definition files.
process.env.AWS_REGION = region;

Expand Down

0 comments on commit 5608424

Please sign in to comment.