From e4b96a17668744f6aa505592db54f3406167f990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?MJ=E2=98=94?= Date: Mon, 19 Feb 2024 12:18:24 -0800 Subject: [PATCH] fix unit test --- packages/backend/src/engine/amplify_stack.ts | 4 ++-- .../backend/src/project_environment_main_stack_creator.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/engine/amplify_stack.ts b/packages/backend/src/engine/amplify_stack.ts index d54aa35573..59c2eb9743 100644 --- a/packages/backend/src/engine/amplify_stack.ts +++ b/packages/backend/src/engine/amplify_stack.ts @@ -1,4 +1,4 @@ -import { CfnElement, Stack } from 'aws-cdk-lib'; +import { Stack } from 'aws-cdk-lib'; /** * Amplify-specific Stack implementation to handle cross-cutting concerns for all Amplify stacks @@ -7,7 +7,7 @@ export class AmplifyStack extends Stack { /** * Overrides Stack.allocateLogicalId to prevent redundant nested stack logical IDs */ - allocateLogicalId = (element: CfnElement): string => { + allocateLogicalId = (element: CfnEleme_cnt): string => { // Nested stack logical IDs have a redundant structure of NestedStackNestedStackResource // This rewrites the nested stack logical ID to const defaultId = super.allocateLogicalId(element); diff --git a/packages/backend/src/project_environment_main_stack_creator.ts b/packages/backend/src/project_environment_main_stack_creator.ts index fbadb59b57..11c8326a9e 100644 --- a/packages/backend/src/project_environment_main_stack_creator.ts +++ b/packages/backend/src/project_environment_main_stack_creator.ts @@ -22,9 +22,10 @@ export class ProjectEnvironmentMainStackCreator implements MainStackCreator { */ getOrCreateMainStack = (): Stack => { if (this.mainStack === undefined) { + const backendIdentifierConversions = new BackendIdentifierConversions(); this.mainStack = new AmplifyStack( this.scope, - BackendIdentifierConversions.toStackName(this.backendId) + backendIdentifierConversions.toStackName(this.backendId) ); }