Skip to content

Support for RDS JSON-style connection strings #38

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

Closed
stephenh opened this issue Apr 26, 2020 · 2 comments
Closed

Support for RDS JSON-style connection strings #38

stephenh opened this issue Apr 26, 2020 · 2 comments

Comments

@stephenh
Copy link

stephenh commented Apr 26, 2020

This is perhaps a little too-cute, but for applications/libraries using Amazon's RDS, RDS/CloudFormation can auto-secret/manage secrets in the AWS Secrets Manager that ends up being a JSON string that looks like:

{
  "host":"whateverrds.amazon.com",
  "port":5432,
  "username":"...",
  "password":"...",
  "dbname":"..."
}

(Without newlines, just formatted for the issue.)

It'd be nice if I could call parse(...) with the ^ string and have it recognize "oh right this is RDS json" and "do the right thing".

My use case is that I'm writing a library that reads connection information from an environment variable, and it'd be great if users could pass either the currently-supported parse connection strings, or, if they're running in RDS, this auto-managed secret value value.

Granted, I can manage this sort of "if/else" in my library, dunno, just seemed like it'd be neat (and lazy for me) if pg-connection-string did it.

I can work on a PR if this seems okay.

@hjr3
Copy link
Contributor

hjr3 commented Apr 29, 2020

@stephenh interesting use case. I am not sure what "do the right thing" is though. Also, we just merge this repo into node-postgres in brianc/node-postgres#2184 . That probably means we should take that discussion over to that repository.

@stephenh
Copy link
Author

Great, saw that that happened. I'll re-post over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants