Skip to content

feat(rds): validate backup retention for read replica instances - #17569

Merged
mergify[bot] merged 7 commits into
aws:masterfrom
jogold:rds-replica-backup
Nov 19, 2021
Merged

mergify[bot] merged 7 commits into
aws:masterfrom
jogold:rds-replica-backup

Conversation

@jogold

@jogold jogold commented Nov 18, 2021

Copy link
Copy Markdown
Contributor

Automatic backups of read replica instances are only supported for MySQL
and MariaDB.

See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.Overview.Differences

Closes #17356


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Automatic backups of read replica instances are only supported for MySQL
and MariaDB.

Closes aws#17356
@gitpod-io

gitpod-io Bot commented Nov 18, 2021

Copy link
Copy Markdown

@github-actions github-actions Bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Nov 18, 2021

@skinny85 skinny85 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Tiny comments, mainly about using a private function we have in the module (engineDescription()).

backupRetention,
instanceType,
vpc,
})).toThrow(/Cannot set `backupRetention` for a postgres read replica/);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
})).toThrow(/Cannot set `backupRetention` for a postgres read replica/);
expect(() =>{
new rds.DatabaseInstanceReadReplica(stack, 'Replica', {
sourceDatabaseInstance: source,
backupRetention,
instanceType,
vpc,
});
}).toThrow(/Cannot set `backupRetention` for a postgres read replica/);

(Sorry, GutHub's UI seems screwed up today, I can't select lines correctly)

@jogold jogold Nov 19, 2021 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. A note on this { } style and why I prefer the other style for toThrow expectations: it allows to "easily" add statements inside the { } which is not a good practice when testing that a single statement should throw.

expect(() => myFun()).toThrow(); // cannot easily add statements inside the throw expectation
expect(() => {
  myFun(); // can easily add statements inside (above or below)
}).toThrow();

😄

@skinny85 skinny85 Nov 19, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, but for me, it's more important that I see what's being tested (myFun() in this case) on a separate line 🙂.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. The change has been made.

@mergify
mergify Bot dismissed skinny85’s stale review November 19, 2021 06:59

Pull request has been modified.

@jogold
jogold requested a review from skinny85 November 19, 2021 08:25
Comment thread packages/@aws-cdk/aws-rds/README.md Resolved

@skinny85 skinny85 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work, as usual. Thanks @jogold!

@mergify

mergify Bot commented Nov 19, 2021

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 6c33bc2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
mergify Bot merged commit 9b2158b into aws:master Nov 19, 2021
@mergify

mergify Bot commented Nov 19, 2021

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…17569)

Automatic backups of read replica instances are only supported for MySQL
and MariaDB.

See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.Overview.Differences

Closes aws#17356


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
ali-n4i pushed a commit to ali-n4i/aws-cdk that referenced this pull request Jul 29, 2026
…17569)

Automatic backups of read replica instances are only supported for MySQL
and MariaDB.

See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html#USER_ReadRepl.Overview.Differences

Closes aws#17356


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@aws-cdk/aws-rds Related to Amazon Relational Database

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-rds): DB Backups not supported on a read replica for engine postgres

3 participants