From a66bd14ee001e0bd20976ccf6141f17e9b43fe8e Mon Sep 17 00:00:00 2001 From: John Hockett Date: Sun, 7 Feb 2021 17:19:02 -0800 Subject: [PATCH] fix(amplify-provider-awscloudformation): check proj config b4 env vars (#6565) --- .../src/configuration-manager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/amplify-provider-awscloudformation/src/configuration-manager.ts b/packages/amplify-provider-awscloudformation/src/configuration-manager.ts index 302819a87be..e810ba0e246 100644 --- a/packages/amplify-provider-awscloudformation/src/configuration-manager.ts +++ b/packages/amplify-provider-awscloudformation/src/configuration-manager.ts @@ -741,6 +741,10 @@ async function determineAuthFlow(context: $TSContext, projectConfig?: ProjectCon useProfile: boolean; } = cfnParams || {}; + // Check for local project config + useProfile = useProfile ?? projectConfig?.config?.useProfile; + profileName = profileName ?? projectConfig?.config?.profileName; + if (context?.exeInfo?.inputParams?.yes) { if (process.env.AWS_SDK_LOAD_CONFIG) { useProfile = useProfile === undefined ? true : useProfile; @@ -752,10 +756,6 @@ async function determineAuthFlow(context: $TSContext, projectConfig?: ProjectCon region = region || resolveRegion(); } - // Check for local project config - useProfile = useProfile ?? projectConfig?.config?.useProfile; - profileName = profileName ?? projectConfig?.config?.profileName; - if (useProfile && profileName) { return { type: 'profile', profileName }; }