From c2642942cc38126284524eb53420852e6b0089e1 Mon Sep 17 00:00:00 2001 From: Calvin Combs Date: Wed, 3 Jan 2024 14:50:49 -0800 Subject: [PATCH] comments --- packages/aws-cdk/lib/api/util/cloudformation.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/aws-cdk/lib/api/util/cloudformation.ts b/packages/aws-cdk/lib/api/util/cloudformation.ts index cd42d1737bf30..18f627fe8c1d0 100644 --- a/packages/aws-cdk/lib/api/util/cloudformation.ts +++ b/packages/aws-cdk/lib/api/util/cloudformation.ts @@ -309,6 +309,9 @@ export type CreateChangeSetOptions = { * Create a changeset for a diff operation */ export async function createDiffChangeSet(options: PrepareChangeSetOptions): Promise { + // `options.stack` has been modified to include any nested stack templates directly inline with its own template, under a special `NestedTemplate` property. + // Thus the parent template's Resources section contains the nested template's CDK metadata check, which uses Fn::Equals. + // This causes CreateChangeSet to fail with `Template Error: Fn::Equals cannot be partially collapsed`. for (const resource of Object.values((options.stack.template.Resources ?? {}))) { if ((resource as any).Type === 'AWS::CloudFormation::Stack') { // eslint-disable-next-line no-console