https://github.com/kanmu/rdsauth
rdsauth is a tool to generate an auth token used to connect to a db with IAM credentials.
https://github.com/kanmu/rdsauth
aws golang iam rds
Last synced: about 2 months ago
JSON representation
rdsauth is a tool to generate an auth token used to connect to a db with IAM credentials.
- Host: GitHub
- URL: https://github.com/kanmu/rdsauth
- Owner: kanmu
- License: mit
- Created: 2024-12-04T07:22:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-23T03:49:52.000Z (2 months ago)
- Last Synced: 2026-04-23T05:29:01.476Z (2 months ago)
- Topics: aws, golang, iam, rds
- Language: Go
- Homepage:
- Size: 89.8 KB
- Stars: 3
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rdsauth
[](https://github.com/kanmu/rdsauth/actions/workflows/ci.yml)
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 [flags]
Arguments:
Database URL
Flags:
-h, --help Show help.
-e, --export Output as environment variable.
--version
```
### PostgreSQL
```sh
$ 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
```sh
$ 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
```sh
$ dig +short cname my-db.example.com
database-1.cluster-abcdef012345.us-east-1.rds.amazonaws.com
$ $(rdsauth -e postgres://scott@my-db.example.com)
$ psql -h my-db.example.com -U scott
...
postgres=>
```