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 }; }