From 70a9c1ece1542117cc0e8a15bc03a2eb005cfd1f Mon Sep 17 00:00:00 2001 From: Cory Hall <43035978+corymhall@users.noreply.github.com> Date: Tue, 6 Dec 2022 10:18:44 -0500 Subject: [PATCH] chore(core): fix bootstrapQualifier (#23246) ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Construct Runtime Dependencies: * [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts | 9 ++++----- .../core/lib/stack-synthesizers/stack-synthesizer.ts | 8 ++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts index 6ccccacc5062b..1350ad1d7f1a3 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/nested.ts @@ -11,13 +11,12 @@ import { IStackSynthesizer, ISynthesisSession } from './types'; * App builder do not need to use this class directly. */ export class NestedStackSynthesizer extends StackSynthesizer { - /** - * The qualifier used to bootstrap this stack - */ - public readonly bootstrapQualifier?: string; constructor(private readonly parentDeployment: IStackSynthesizer) { super(); - this.bootstrapQualifier = parentDeployment.bootstrapQualifier; + } + + public get bootstrapQualifier(): string | undefined { + return this.parentDeployment.bootstrapQualifier; } public addFileAsset(asset: FileAssetSource): FileAssetLocation { diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts index 311a648561bd3..51b0b66e0774a 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/stack-synthesizer.ts @@ -19,6 +19,14 @@ import { IStackSynthesizer, ISynthesisSession } from './types'; * and could not be accessed by external implementors. */ export abstract class StackSynthesizer implements IStackSynthesizer { + + /** + * The qualifier used to bootstrap this stack + */ + public get bootstrapQualifier(): string | undefined { + return undefined; + } + private _boundStack?: Stack; /**