Skip to content
/ rdsauth Public

rdsauth is a tool to generate an auth token used to connect to a db with IAM credentials.

License

Notifications You must be signed in to change notification settings

kanmu/rdsauth

Repository files navigation

rdsauth

CI

rdsauth is a tool to generate an auth token used to connect to a db with IAM credentials.

Download

https://github.com/kanmu/rdsauth/releases/latest

Usage

Usage: rdsauth <url> [flags]

Arguments:
  <url>    Database URL

Flags:
  -h, --help       Show help.
  -e, --export     Output as environment variable.
      --version

PostgreSQL

$ MY_DB_HOST=database-1.cluster-abcdef012345.us-east-1.rds.amazonaws.com
$ $(rdsauth -e postgres://scott@$MY_DB_HOST)
$ psql -h $MY_DB_HOST -U scott
...
postgres=>

MySQL

$ MY_DB_HOST=database-1.cluster-abcdef012345.us-east-1.rds.amazonaws.com
$ $(rdsauth -e mysql://scott@$MY_DB_HOST)
$ mysql -h $MY_DB_HOST -u scott --enable-cleartext-plugin
...
mysql>

CNAME support

$ dig +short cname my-db.example.com
database-1.cluster-abcdef012345.us-east-1.rds.amazonaws.com

$ $(rdsauth -e postgres://[email protected])
$ psql -h my-db.example.com -U scott
...
postgres=>

About

rdsauth is a tool to generate an auth token used to connect to a db with IAM credentials.

Topics

Resources

License

Stars

Watchers

Forks