Skip to content

Commit

Permalink
feat(stack-set)!: Remove support for Stack Sets
Browse files Browse the repository at this point in the history
Removes supports for Stack Sets (added in #977) as it's no longer used,
because of a lack of CD tooling support for deploying Stack Sets.

Removing unused code means less code to maintain, and reduced complexity.

Should Stack Sets be needed in future, https://github.com/cdklabs/cdk-stacksets offers an alternative approach to creating them in CDK.
  • Loading branch information
akash1810 committed Dec 20, 2023
1 parent 7a22590 commit af50cf5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 529 deletions.
10 changes: 10 additions & 0 deletions .changeset/curly-peas-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@guardian/cdk": major
---

Removes supports for Stack Sets (added in #977) as it's no longer used,
because of a lack of CD tooling support for deploying Stack Sets.

Removing unused code means less code to maintain, and reduced complexity.

Should Stack Sets be needed in future, https://github.com/cdklabs/cdk-stacksets offers an alternative approach to creating them in CDK.
21 changes: 2 additions & 19 deletions src/constructs/core/stack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { CfnElement, StackProps } from "aws-cdk-lib";
import { Annotations, App, Aspects, CfnParameter, LegacyStackSynthesizer, Stack, Tags } from "aws-cdk-lib";
import { Template } from "aws-cdk-lib/assertions";
import type { App, CfnElement, StackProps } from "aws-cdk-lib";
import { Annotations, Aspects, CfnParameter, LegacyStackSynthesizer, Stack, Tags } from "aws-cdk-lib";
import type { IConstruct } from "constructs";
import gitUrlParse from "git-url-parse";
import { AwsBackupTag } from "../../aspects/aws-backup";
Expand Down Expand Up @@ -268,19 +267,3 @@ export class GuStack extends Stack implements StackStageIdentity {
Annotations.of(construct).addInfo(`Setting logical ID for ${id} to ${logicalId}. Reason: ${reason}`);
}
}

/**
* A GuStack but designed for Stack Set instances.
*
* In a stack set application, `GuStackForStackSetInstance` is used to represent the infrastructure to provision in target AWS accounts.
*/
export class GuStackForStackSetInstance extends GuStack {
// eslint-disable-next-line custom-rules/valid-constructors -- GuStackForStackSet should have a unique `App`
constructor(id: string, props: GuStackProps) {
super(new App(), id, props);
}

get cfnJson(): string {
return JSON.stringify(Template.fromStack(this).toJSON(), null, 2);
}
}
265 changes: 0 additions & 265 deletions src/constructs/stack-set/__snapshots__/stack-set.test.ts.snap

This file was deleted.

1 change: 0 additions & 1 deletion src/constructs/stack-set/index.ts

This file was deleted.

69 changes: 0 additions & 69 deletions src/constructs/stack-set/stack-set.test.ts

This file was deleted.

Loading

0 comments on commit af50cf5

Please sign in to comment.