Skip to content

Commit dee720d

Browse files
committed
fix(cli): cdk deploy is listing deprecated ids
The new recommended way of selecting stacks is by their construct path, however when prompted the CLI is printing the deprecated identifiers.
1 parent 27c176a commit dee720d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

packages/aws-cdk/lib/api/cxapp/cloud-assembly.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class CloudAssembly {
156156
return new StackCollection(this, topLevelStacks);
157157
} else {
158158
throw new Error('Since this app includes more than a single stack, specify which stacks to use (wildcards are supported) or specify `--all`\n' +
159-
`Stacks: ${stacks.map(x => x.id).join(' ')}`);
159+
`Stacks: ${stacks.map(x => x.hierarchicalId).join(' · ')}`);
160160
}
161161
default:
162162
throw new Error(`invalid default behavior: ${defaultSelection}`);

packages/aws-cdk/test/api/cloud-assembly.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ test('select behavior: single', async () => {
8686
.rejects.toThrow('Since this app includes more than a single stack, specify which stacks to use (wildcards are supported) or specify `--all`');
8787
});
8888

89+
test('stack list error contains node paths', async () => {
90+
// GIVEN
91+
const cxasm = await testCloudAssembly();
92+
93+
// WHEN
94+
await expect(cxasm.selectStacks({ patterns: [] }, { defaultBehavior: DefaultSelection.OnlySingle }))
95+
.rejects.toThrow('withouterrorsNODEPATH');
96+
});
97+
8998
test('select behavior: repeat', async () => {
9099
// GIVEN
91100
const cxasm = await testCloudAssembly();
@@ -147,6 +156,7 @@ async function testCloudAssembly({ env }: { env?: string, versionReporting?: boo
147156
const cloudExec = new MockCloudExecutable({
148157
stacks: [{
149158
stackName: 'withouterrors',
159+
displayName: 'withouterrorsNODEPATH',
150160
env,
151161
template: { resource: 'noerrorresource' },
152162
},

0 commit comments

Comments
 (0)