Skip to content

Commit 72325c9

Browse files
committed
feat: Add AWS IAM authentication support for MySQL
- Add @aws-sdk/rds-signer dependency for RDS auth token generation - Extend CLI arguments with --aws-iam-auth and --aws-region options - Implement automatic AWS RDS auth token generation in MySQL adapter - Auto-enable SSL for AWS IAM authentication (required by RDS) - Add comprehensive error handling for AWS credential issues - Update documentation with AWS IAM authentication examples - Maintain backward compatibility with existing authentication methods Resolves the need for secure AWS RDS connections without hardcoded passwords.
1 parent 70d1b96 commit 72325c9

File tree

6 files changed

+1639
-185
lines changed

6 files changed

+1639
-185
lines changed

docs/docs/connection-reference.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,29 @@ node dist/src/index.js --postgresql --host dbserver.example.com --database sampl
7575
| `--mysql` | Specifies MySQL mode | - | Yes |
7676
| `--host` | MySQL hostname or IP | - | Yes |
7777
| `--database` | Database name | - | Yes |
78-
| `--user` | MySQL username | - | No |
79-
| `--password` | MySQL password | - | No |
78+
| `--user` | MySQL username | - | No* |
79+
| `--password` | MySQL password | - | No* |
8080
| `--port` | MySQL port | 3306 | No |
8181
| `--ssl` | Use SSL connection (true/false or object) | false | No |
8282
| `--connection-timeout` | Connection timeout in ms | 30000 | No |
83+
| `--aws-iam-auth` | Enable AWS IAM authentication | false | No |
84+
| `--aws-region` | AWS region for RDS IAM auth | - | No** |
8385

84-
### Example
86+
*Required for standard authentication
87+
**Required when using `--aws-iam-auth`
88+
89+
### Standard Authentication Example
8590

8691
```bash
8792
node dist/src/index.js --mysql --host localhost --database sample_db --port 3306 --user root --password secret
8893
```
8994

95+
### AWS IAM Authentication Example
96+
97+
```bash
98+
node dist/src/index.js --mysql --aws-iam-auth --host rds-endpoint.region.rds.amazonaws.com --database sample_db --user aws-username --aws-region us-east-1
99+
```
100+
90101
## Environment Variables
91102

92103
Instead of specifying sensitive credentials on the command line, you can use environment variables:

0 commit comments

Comments
 (0)