Skip to content

(aws-rds): Add lookup functonality #31720

@JoshMcCullough

Description

@JoshMcCullough

Describe the feature

See related ticket: #7295

We would like a lookup function so we can fetch an RDS Database Instance reference by id, similar to other constructs.

Use Case

Currently, we need to provide many things (instanceIdentifier, instanceEndpointAddress, port, securityGroups) in order to use an existing RDS Database Instance in the stack. This is "untenable" as hard-coding them is not a good idea.

Proposed Solution

Add a lookup, e.g.:

const dbInstance = DatabaseInstance.fromLookup(stack, "DbInstance", { databaseIdentifier: "my-db-instance" });

Other Information

No response

Acknowledgements

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

CDK version used

2.161.0

Environment details (OS name and version, etc.)

Manjaro Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-rdsRelated to Amazon Relational Databaseeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.open-for-community-contributionWe are welcoming community contributions for this onep2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions