diff --git a/packages/amplify-provider-awscloudformation/src/override-manager/transform-resource.ts b/packages/amplify-provider-awscloudformation/src/override-manager/transform-resource.ts index 3f38933fb80..baa40b60ceb 100644 --- a/packages/amplify-provider-awscloudformation/src/override-manager/transform-resource.ts +++ b/packages/amplify-provider-awscloudformation/src/override-manager/transform-resource.ts @@ -20,13 +20,13 @@ export async function transformResourceWithOverrides(context: $TSContext, resour if (resource) { const { transformCategoryStack } = await import(`@aws-amplify/amplify-category-${resource.category}`); if (transformCategoryStack) { - return transformCategoryStack(context, resource); + return await transformCategoryStack(context, resource); } else { printer.info('Overrides functionality is not impleented for this category'); } } else { if (FeatureFlags.getBoolean('overrides.project')) { - storeRootStackTemplate(context); + await storeRootStackTemplate(context); } } } catch (err) { diff --git a/packages/amplify-provider-awscloudformation/src/push-resources.ts b/packages/amplify-provider-awscloudformation/src/push-resources.ts index 06994d65aae..68900c8f4f8 100644 --- a/packages/amplify-provider-awscloudformation/src/push-resources.ts +++ b/packages/amplify-provider-awscloudformation/src/push-resources.ts @@ -289,7 +289,7 @@ export async function run(context: $TSContext, resourceDefinition: $TSObject, re try { await updateCloudFormationNestedStack(context, nestedStack, resourcesToBeCreated, resourcesToBeUpdated); if (FeatureFlags.getBoolean('Overrides.project')) { - storeRootStackTemplate(context, nestedStack); + await storeRootStackTemplate(context, nestedStack); // if the only root stack updates, function is called with empty resources . this fn copies amplifyMeta and backend Config to #current-cloud-backend context.amplify.updateamplifyMetaAfterPush([]); } @@ -711,7 +711,7 @@ async function updateCloudFormationNestedStack( const projectRoot = pathManager.findProjectRoot(); const rootStackFilePath = path.join(pathManager.getRootStackBuildDirPath(projectRoot), rootStackFileName); // deploy preprocess nested stack to disk - storeRootStackTemplate(context, nestedStack); + await storeRootStackTemplate(context, nestedStack); const transformedStackPath = await preProcessCFNTemplate(rootStackFilePath); const cfnItem = await new Cloudformation(context, generateUserAgentAction(resourcesToBeCreated, resourcesToBeUpdated)); const providerDirectory = path.normalize(path.join(backEndDir, providerName)); @@ -1185,7 +1185,7 @@ export async function generateAndUploadRootStack(context: $TSContext, destinatio const projectDetails = context.amplify.getProjectDetails(); const nestedStack = await formNestedStack(context, projectDetails); - storeRootStackTemplate(context, nestedStack); + await storeRootStackTemplate(context, nestedStack); // upload the nested stack const s3Client = await S3.getInstance(context);