Skip to content
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

(aws-rds): Add lookup functonality #31720

Open
1 of 2 tasks
JoshMcCullough opened this issue Oct 10, 2024 · 5 comments · May be fixed by #33258
Open
1 of 2 tasks

(aws-rds): Add lookup functonality #31720

JoshMcCullough opened this issue Oct 10, 2024 · 5 comments · May be fixed by #33258
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. open-for-community-contribution We are welcoming community contributions for this one p2

Comments

@JoshMcCullough
Copy link

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

@JoshMcCullough JoshMcCullough added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2024
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Oct 10, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2024
@khushail khushail self-assigned this Oct 10, 2024
@khushail khushail changed the title RDS: Add lookup functonality (aws-rds): Add lookup functonality Oct 10, 2024
@khushail
Copy link
Contributor

Hi @JoshMcCullough , thanks for requesting this.

As far as current implementation goes and mentioned in the linked issue as well, fromDatabaseInstanceAttribute() method exists which needs few parameters as input.

public static fromDatabaseInstanceAttributes(scope: Construct, id: string, attrs: DatabaseInstanceAttributes): IDatabaseInstance {

Having an instance lookup method would definitely be useful.

Thanks for volunteering for this implementation. Looking forward to your PR!

@khushail khushail added effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Oct 10, 2024
@khushail khushail removed their assignment Oct 10, 2024
@JoshMcCullough
Copy link
Author

I'd prefer if someone else would do the PR, but I can try ... maybe.

@QuantumNeuralCoder QuantumNeuralCoder added the open-for-community-contribution We are welcoming community contributions for this one label Oct 21, 2024
@pcheungamz
Copy link

If no one is currently working on this, I can take it.

@khushail
Copy link
Contributor

@pcheungamz , thanks for volunteering. please feel free to work on it. Looking forward to your PR!

@pcheungamz
Copy link

Hi @khushail, I would like your advice on my approach. After looking at .fromLookup in aws-route53.HostedZone, aws-ec2.Vpc, and aws-kms.Key. I think these are the steps:

Am I going down the right path? I don't think this is a small effort. Would appreciate your guidance. Thanks.

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 effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. open-for-community-contribution We are welcoming community contributions for this one p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants