Skip to content

Commit a7dbeef

Browse files
authored
fix(aws-cdk): include nested stacks when building changesets (#17396)
This is a workaround for #5722 - users can do `cdk deploy --no-execute` and then view the nested changesets as a way to get a full diff of changes. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5df8f12 commit a7dbeef

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/aws-cdk/lib/api/deploy-stack.ts

+1
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ async function prepareAndExecuteChangeSet(
299299
StackName: deployName,
300300
ChangeSetName: changeSetName,
301301
ChangeSetType: update ? 'UPDATE' : 'CREATE',
302+
IncludeNestedStacks: true,
302303
Description: `CDK Changeset for execution ${executionId}`,
303304
TemplateBody: bodyParameter.TemplateBody,
304305
TemplateURL: bodyParameter.TemplateURL,

packages/aws-cdk/test/api/deploy-stack.test.ts

+12
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,18 @@ test('correctly passes CFN parameters, ignoring ones with empty values', async (
164164
}));
165165
});
166166

167+
test('correctly passes IncludeNestedStacks', async () => {
168+
// WHEN
169+
await deployStack({
170+
...standardDeployStackArguments(),
171+
});
172+
173+
// THEN
174+
expect(cfnMocks.createChangeSet).toHaveBeenCalledWith(expect.objectContaining({
175+
IncludeNestedStacks: true,
176+
}));
177+
});
178+
167179
test('reuse previous parameters if requested', async () => {
168180
// GIVEN
169181
givenStackExists({

0 commit comments

Comments
 (0)