Skip to content

Support for RDS JSON-style connection strings #38

Closed
@stephenh

Description

@stephenh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions