From 35e83719f55e6aab6c0812a13c7e4a686442a72d Mon Sep 17 00:00:00 2001 From: Mario Doiron <5252025+doiron@users.noreply.github.com> Date: Tue, 18 Apr 2023 23:21:42 -0700 Subject: [PATCH] fix: default region not getting set correctly --- lib/builtins/deploy-delegates/cfn-deployer/index.js | 4 ++-- lib/builtins/deploy-delegates/lambda-deployer/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/builtins/deploy-delegates/cfn-deployer/index.js b/lib/builtins/deploy-delegates/cfn-deployer/index.js index 85ed4ae2..917b14e5 100644 --- a/lib/builtins/deploy-delegates/cfn-deployer/index.js +++ b/lib/builtins/deploy-delegates/cfn-deployer/index.js @@ -20,7 +20,7 @@ module.exports = { * @param {Object} options * @param {Function} callback */ -function bootstrap(options, callback) { +async function bootstrap(options, callback) { const {profile, workspacePath} = options; const userConfig = options.userConfig || {}; const templateLocation = path.join(workspacePath, SKILL_STACK_PUBLIC_FILE_NAME); @@ -28,7 +28,7 @@ function bootstrap(options, callback) { try { const templateContent = fs.readFileSync(path.join(__dirname, "assets", SKILL_STACK_ASSET_FILE_NAME), "utf-8"); const awsProfile = awsUtil.getAWSProfile(profile); - const awsDefaultRegion = awsUtil.getCLICompatibleDefaultRegion(awsProfile); + const awsDefaultRegion = await awsUtil.getCLICompatibleDefaultRegion(awsProfile); fs.writeFileSync(templateLocation, templateContent); userConfig.templatePath = `./${path.posix.join("infrastructure", path.basename(workspacePath), SKILL_STACK_PUBLIC_FILE_NAME)}`; updatedUserConfig = R.set(R.lensPath(["awsRegion"]), awsDefaultRegion, userConfig); diff --git a/lib/builtins/deploy-delegates/lambda-deployer/index.js b/lib/builtins/deploy-delegates/lambda-deployer/index.js index 086f3246..7a266115 100644 --- a/lib/builtins/deploy-delegates/lambda-deployer/index.js +++ b/lib/builtins/deploy-delegates/lambda-deployer/index.js @@ -14,10 +14,10 @@ module.exports = { * @param {Object} options * @param {Function} callback */ -function bootstrap(options, callback) { +async function bootstrap(options, callback) { const {profile, userConfig} = options; const awsProfile = awsUtil.getAWSProfile(profile); - const awsDefaultRegion = awsUtil.getCLICompatibleDefaultRegion(awsProfile); + const awsDefaultRegion = await awsUtil.getCLICompatibleDefaultRegion(awsProfile); const updatedUserConfig = R.set(R.lensPath(["awsRegion"]), awsDefaultRegion, userConfig); callback(null, {userConfig: updatedUserConfig}); }