|
1 | | -# @aws-sdk/rds-signer |
2 | | - |
3 | | -[](https://www.npmjs.com/package/@aws-sdk/rds-signer) |
4 | | -[](https://www.npmjs.com/package/@aws-sdk/rds-signer) |
| 1 | +# @aws-sdk/nested-clients |
5 | 2 |
|
6 | 3 | ## Description |
7 | 4 |
|
8 | | -This package provides utilities for interacting with RDS. |
9 | | - |
10 | | -## Installation |
11 | | - |
12 | | -```console |
13 | | -npm install @aws-sdk/rds-signer |
14 | | -``` |
15 | | - |
16 | | -## Getting Started |
17 | | - |
18 | | -### Import |
19 | | - |
20 | | -ES6 import |
21 | | - |
22 | | -```js |
23 | | -import { Signer } from "@aws-sdk/rds-signer"; |
24 | | -``` |
25 | | - |
26 | | -Or CommonJS import |
27 | | - |
28 | | -```js |
29 | | -const { Signer } = require("@aws-sdk/rds-signer"); |
30 | | -``` |
31 | | - |
32 | | -### Generate Authentication Token for RDS IAM Authentication |
33 | | - |
34 | | -```js |
35 | | -const signer = new Signer({ |
36 | | - /** |
37 | | - * Required. The hostname of the database to connect to. |
38 | | - */ |
39 | | - hostname: "db.us-east-1.rds.amazonaws.com", |
40 | | - /** |
41 | | - * Required. The port number the database is listening on. |
42 | | - */ |
43 | | - port: 8000, |
44 | | - /** |
45 | | - * Required. The username to login as. |
46 | | - */ |
47 | | - username: "user1", |
48 | | - /** |
49 | | - * Optional. The AWS credentials to sign requests with. Uses the default credential provider chain in not specified. |
50 | | - */ |
51 | | - credentials: fromNodeCredentialProvider(), |
52 | | - /** |
53 | | - * Optional. The region the database is located in. Uses the region inferred from the runtime if omitted. |
54 | | - */ |
55 | | - region: "us-east-1", |
56 | | - /** |
57 | | - * Optional. The SHA256 hasher constructor to sign the request. |
58 | | - */ |
59 | | - sha256: HashCtor, |
60 | | -}); |
61 | | - |
62 | | -const token = await signer.getAuthToken(); |
63 | | -// Use this token as the password for connecting to your RDS instance |
64 | | -``` |
65 | | - |
66 | | -For more details and examples, refer to the following resources. Usage is similar across DB engines. |
67 | | - |
68 | | -- [Connecting to your DB instance using IAM authentication](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.Connecting.html) |
69 | | -- [IAM database authentication for MySQL and PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html) |
70 | | -- [Using IAM authentication to connect with pgAdmin Amazon Aurora PostgreSQL or Amazon RDS for PostgreSQL](https://aws.amazon.com/blogs/database/using-iam-authentication-to-connect-with-pgadmin-amazon-aurora-postgresql-or-amazon-rds-for-postgresql/) |
71 | | -- [Use IAM authentication to connect with SQL Workbench/J to Amazon Aurora MySQL or Amazon RDS for MySQL](https://aws.amazon.com/blogs/database/use-iam-authentication-to-connect-with-sql-workbenchj-to-amazon-aurora-mysql-or-amazon-rds-for-mysql/) |
72 | | -- [AWS CLI v2 rds generate-db-auth-token Documentation](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/generate-db-auth-token.html) |
| 5 | +This is an internal package. Do not install this as a direct dependency. |
0 commit comments