-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(rds): add fromLookup
method for Amazon Aurora Database Cluster
#34849
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
Conversation
fromLookup
method for Amazon Aurora Database Cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! I've added some small comments.
* Lookup an existing DatabaseCluster using clusterIdentifier. | ||
*/ | ||
public static fromLookup(scope: Construct, id: string, options: DatabaseClusterLookupOptions): IDatabaseCluster { | ||
const response: {[key: string]: any}[] = ContextProvider.getValue(scope, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding a validation to ensure that clusterIdentifier
is not a token.
ref1: https://github.com/aws/aws-cdk/pull/33619/files#diff-b209f8fb85158efdb494a934528ef03b97b97e4b8785997c3fb6e25f08ccb472R132
ref2: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-ecr/lib/repository.ts#L645
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Added a validation and a unit test.
Co-authored-by: Kazuho Cryer-Shinozuka <[email protected]>
@badmintoncryer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution, approved
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). |
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #34848 .
Reason for this change
Implement a lookup function for RDS DatabaseCluster similar to the existing DatabaseInstance.fromLookup functionality.
#33258
This allows users to fetch an Aurora RDS cluster reference by identifier rather than having to manually provide all connection details.
Description of changes
Add
fromLookup
method toDatabaseCluster
.Describe any new or updated permissions being added
N/A
Description of how you validated changes
Add unit tests and an integ test.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license