Skip to content

Commit

Permalink
feat: StackSet stack does not show up in stack list
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarbe committed Jan 3, 2023
1 parent 2cf7228 commit 175201e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
6 changes: 6 additions & 0 deletions src/stack-set-synthesizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ export class StackSetSynthesizer extends cdk.DefaultStackSynthesizer {
public addDockerImageAsset(_asset: cdk.DockerImageAssetSource): cdk.DockerImageAssetLocation {
throw new Error('StackSet Stacks do not support Docker Image Assets, yet');
}

public synthesize(session: cdk.ISynthesisSession): void {
// Synthesize the template, but don't emit as a cloud assembly artifact.
// It will be registered as an S3 asset of its parent instead.
this.synthesizeTemplate(session);
}
}
16 changes: 1 addition & 15 deletions test/stack-set.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ it('should have a defined list of files in cloud assembly', () => {
const session = app.synth();

const parentStackFiles = ['Parent.assets.json', 'Parent.template.json'];
const stackSetStackFiles = ['ParentTemplate0B4BAA82.assets.json', 'ParentTemplate0B4BAA82.stackset.template.json'];
const stackSetStackFiles = ['ParentTemplate0B4BAA82.stackset.template.json'];
const cdkStandarddFiles = ['cdk.out', 'manifest.json', 'tree.json'];
const assetsForS3Deployment = [
'asset.2bc265c5e0569aeb24a6349c15bd54e76e845892376515e036627ab0cc70bb64', // "Copy" Lambda Function
Expand Down Expand Up @@ -178,20 +178,6 @@ it('should have the stack template as an asset', () => {
});
});


it('Template for StackSet should not have any assets', () => {
const app = new cdk.App();
new MyStackSetStack(app, 'Parent');

const session = app.synth();

expect(readJson(session.directory, 'ParentTemplate0B4BAA82.assets.json')).toMatchObject({
dockerImages: {},
files: {},
version: '22.0.0',
});
});

// TODO: Copy job should move it into the right bucket

it('Parent stack should have the assets of StackSet stack', () => {
Expand Down

0 comments on commit 175201e

Please sign in to comment.