Skip to content

(aws-rds): support lookup method for Aurora DatabaseCluster #34848

@mazyu36

Description

@mazyu36

Describe the feature

Related Issue: #31720

Implement a lookup function for RDS DatabaseCluster similar to the existing DatabaseInstance.fromLookup functionality.

This allows users to fetch an Aurora RDS cluster reference by identifier rather than having to manually provide all connection details.

Use Case

Currently, to reference an existing Aurora cluster, users need to provide many details manually using DatabaseCluster.fromDatabaseClusterAttributes().

This is cumbersome and error-prone, especially when these values can change over time.

Proposed Solution

Add lookup method that retrieves all necessary attributes through the CDK context provider:

  const cluster = DatabaseCluster.fromLookup(stack, "AuroraCluster", {
    clusterIdentifier: "my-aurora-cluster"
  });

Other Information

  • Implementation follows the pattern established by DatabaseInstance.fromLookup
  • Added unit and integration tests to verify functionality

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS CDK Library version (aws-cdk-lib)

2.161.0

AWS CDK CLI version

2.1019.1

Environment details (OS name and version, etc.)

OSX

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-rdsRelated to Amazon Relational Databaseeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions