Skip to content

Commit

Permalink
feat(backups)!: Remove stack-level support for configuring DevX Backu…
Browse files Browse the repository at this point in the history
…ps (#2289)

BREAKING CHANGE: DevX Backups can no longer be enabled via the `withBackup`
prop, which has been removed.

Users should now opt-in/out of DevX Backups at the construct level (i.e.
when defining an RDS instance, cluster or DynamoDB table).

We recommend using the `GuDatabaseInstance` or `GuDynamoTable` to help with
this. If these constructs cannot be used, resources can also be tagged like
this: `Tags.of(myDatabase).add("devx-backup-enabled", "true")`.
  • Loading branch information
jacobwinch authored May 1, 2024
1 parent d3f97df commit fa0719b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 95 deletions.
11 changes: 11 additions & 0 deletions .changeset/tiny-steaks-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@guardian/cdk": major
---

BREAKING CHANGE: DevX Backups can no longer be enabled via the `withBackup` prop, which has been removed.

Users should now opt-in/out of DevX Backups at the construct level (i.e. when defining an RDS instance, cluster or
DynamoDB table).

We recommend using the `GuDatabaseInstance` or `GuDynamoTable` to help with this. If these constructs cannot be used,
resources can also be tagged like this: `Tags.of(myDatabase).add("devx-backup-enabled", "true")`.
48 changes: 0 additions & 48 deletions src/aspects/aws-backup.test.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/aspects/aws-backup.ts

This file was deleted.

23 changes: 1 addition & 22 deletions src/constructs/core/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ 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";
import { CfnIncludeReporter } from "../../aspects/cfn-include-reporter";
import { CfnParameterReporter } from "../../aspects/cfn-parameter-reporter";
import { Metadata } from "../../aspects/metadata";
Expand Down Expand Up @@ -46,15 +45,6 @@ export interface GuStackProps extends Omit<StackProps, "stackName"> {
* please do not override this.
*/
withoutMetadata?: boolean;

/**
* Set to enable all resources in the stack for backup provided by https://github.com/guardian/aws-backup.
*
* @default false - backups are not enabled
*
* @see https://github.com/guardian/aws-backup
*/
withBackup?: boolean;
}

/**
Expand Down Expand Up @@ -125,14 +115,7 @@ export class GuStack extends Stack implements StackStageIdentity {

// eslint-disable-next-line custom-rules/valid-constructors -- GuStack is the exception as it must take an App
constructor(scope: App, id: string, props: GuStackProps) {
const {
cloudFormationStackName = process.env.GU_CFN_STACK_NAME,
stack,
stage,
app,
withoutTags,
withBackup = false,
} = props;
const { cloudFormationStackName = process.env.GU_CFN_STACK_NAME, stack, stage, app, withoutTags } = props;

super(scope, id, {
...props,
Expand Down Expand Up @@ -168,10 +151,6 @@ export class GuStack extends Stack implements StackStageIdentity {

Aspects.of(this).add(new CfnIncludeReporter());
Aspects.of(this).add(new CfnParameterReporter());

if (withBackup) {
Aspects.of(this).add(new AwsBackupTag());
}
}

/**
Expand Down

0 comments on commit fa0719b

Please sign in to comment.