-
Notifications
You must be signed in to change notification settings - Fork 4k
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
RDS - Import existing DatabaseInstance from ARN #7295
Comments
You should be able to use
|
It would be great with an example of how this is supposed to work. The suggestion from the author is to import based on arn, the method referred to is requiring instance identifier, port, security group ++. Whats the suggested solution here? To export everything required by the fromInstanceAttributes? |
Not sure whether this is correct, but I would try it like this: const db = rds.DatabaseInstance.fromDatabaseInstanceAttributes(this, "myDb", { instanceIdentifier: "db-name", instanceEndpointAddress: "db-arn", port: 5432, securityGroups: [], }); |
@romor not really :) the question was whether it's possible to get an RDS instance by it's arn. The example you provided, even you are not doing that, the |
The L2 construct needs more information than the ARN to function, so you cannot only reference it by ARN. To be clear - this function does not do a lookup or any API call, it is just a read-only reference to some resources, so you need to provide all the information it needs to it. |
I think what we're looking for here is "simply" a way to not have to provide all of these seemingly extraneous details ( |
Since this is not a lookup (as mentioned above, it does not perform any API calls), it needs all information required by the methods/props that What you're asking for is a "lookup", which is reasonable, but doesn't exist at all for RDS yet - I would open a new feature request for a lookup function for RDS instances. |
Yes, asking for a lookup -- exactly. Submitted a new feature request, thanks! |
Currently the AWS CDK only allows creating a DB instance. It would be great to be able to import and reuse existing RDS instances.
Use Case
Creating a CI pipeline that automatically provisions QA "sandboxes" of the app, that are all connected and reuse the same DB instance.
Because of this use case.
Proposed Solution
DatabaseInstance.fromArn();
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: