8000 feat(rds): `DatabaseInstanceFromSnapshot` support `clusterSnapshotIdentifier` by phuhung273 · Pull Request #33982 · aws/aws-cdk · GitHub
[go: up one dir, main page]

Skip to content

feat(rds): DatabaseInstanceFromSnapshot support clusterSnapshotIdentifier #33982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2025

Conversation

phuhung273
Copy link
Contributor

Issue # (if applicable)

Closes #33889

Reason for this change

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromMultiAZDBClusterSnapshot.html

Description of changes

  • DatabaseInstanceFromSnapshot support clusterSnapshotIdentifier
  • clusterSnapshotIdentifier and snapshotIdentifier are mutually exclusive, one must be specified

Description of how you validated changes

Unit + Integ

Checklist


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

@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 admired-contributor [Pilot] contributed between 13-24 PRs to the CDK labels Mar 31, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team March 31, 2025 16:39
Copy link
codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.39%. Comparing base (a67c3f5) to head (54998d1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33982   +/-   ##
=======================================
  Coverage   82.39%   82.39%           
=======================================
  Files         120      120           
  Lines        6960     6960           
  Branches     1175     1175           
=======================================
  Hits         5735     5735           
  Misses       1120     1120           
  Partials      105      105           
Flag Coverage Δ
suite.unit 82.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.39% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 31, 2025
@ozelalisen ozelalisen self-assigned this Jun 5, 2025
* - Can't be the identifier of an Aurora DB cluster snapshot.
*
* @see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_RestoreFromMultiAZDBClusterSnapshot.html
* @default - restore from `snapshotIdentifier`
Copy link
Member

Choose a reason for hiding this comment

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

It seems this belongs to the default value for the snapshotIdentifier field

* - Can't be specified when `clusterSnapshotIdentifier` is specified.
* - Must be specified when `clusterSnapshotIdentifier` isn't specified.
*
* @default - restore from `clusterSnapshotIdentifier`
Copy link
Member

Choose a reason for hiding this comment

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

It seems this belongs to the default value for the clusterSnapshotIdentifier field

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Lear 10000 n more.

Here I mean if user doesn't specify snapshotIdentifier, it will use clusterSnapshotIdentifier. But agree that looks confusing.

I guess we can simply use None. How do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

Could you point out to me code snippet, how it is gonna use clusterSnapshotIdentifier, if snapshotIdentifier not specified? I do not see this logic inside the code. Maybe I am missing something.

Copy link
Contributor Author
@phuhung273 phuhung273 Jun 6, 2025

Choose a reason for hiding this comment

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

There is no such logic. User have to specify only one of clusterSnapshotIdentifier or snapshotIdentifier. That's why I think we can simply put @default None

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I would prefer that as well.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 6, 2025
@phuhung273 phuhung273 force-pushed the rds-clusterSnapshotIdentifier branch from b3259d7 to 002817e Compare June 6, 2025 12:25
@mergify mergify bot dismissed ozelalisen’s stale review June 6, 2025 12:26

Pull request has been modified.

Copy link
Member
@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

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

Thank you for the changes. LGTM!

Copy link
Contributor
mergify bot commented Jun 6, 2025

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

@phuhung273
Copy link
Contributor Author

Thanks for your review @ozelalisen

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 8229a82
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor
mergify bot commented Jun 6, 2025

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

@mergify mergify bot merged commit 48d30b6 into aws:main Jun 6, 2025
16 checks passed
Copy link
Contributor
github-actions bot commented Jun 6, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2025
@phuhung273 phuhung273 deleted the rds-clusterSnapshotIdentifier branch June 6, 2025 13:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
admired-contributor [Pilot] contributed between 13-24 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rds: DatabaseInstanceFromSnapshot doesn't expose DBClusterSnapshotIdentifier
3 participants
0