You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Was not able to either fetch or read the database credentials from AWS Secrets Manager due to error: %s. Ensure the correct secretId and region properties have been provided.",
"Unable to fetch database credentials with the given username key and password key. Please review the values specified in secretUsernameProperty (%s) and secretPasswordProperty (%s) and ensure they match the Secrets Manager JSON format.",
43
45
"AwsSecretsManagerConnectionPlugin.missingRequiredConfigParameter": "Configuration parameter '%s' is required.",
|`secretId`| String | Yes | Set this value to be the secret name or the secret ARN. |`secretId`|`null`|
26
-
|`secretRegion`| String | Yes unless the `secretId` is an ARN | Set this value to be the region your secret is in. |`us-east-2`|`null`|
27
-
|`secretEndpoint`| String | No | Set this value to be the endpoint override to retrieve your secret from. This parameter value should be in the form of a URL, with a valid protocol (ex. `https://`) and domain (ex. `localhost`). A port number is not required. |`https://localhost:1234`|`null`|
23
+
| Parameter | Value | Required | Description | Example | Default Value |
|`secretId`| String | Yes | Set this value to be the secret name or the secret ARN. |`secretId`|`null`|
26
+
|`secretRegion`| String | Yes unless the `secretId` is an ARN | Set this value to be the region your secret is in. |`us-east-2`|`null`|
27
+
|`secretEndpoint`| String | No | Set this value to be the endpoint override to retrieve your secret from. This parameter value should be in the form of a URL, with a valid protocol (ex. `https://`) and domain (ex. `localhost`). A port number is not required. |`https://localhost:1234`|`null`|
28
+
|`secretExpirationSec`| Integer | No | This property sets the time in seconds that secrets are cached before it is re-fetched. |`600`|`870`|
29
+
|`secretUsernameProperty`| String | No | Set this value to be the key in the JSON secret that contains the username for database connection. |`db_user`|`username`|
30
+
|`secretPasswordProperty`| String | No | Set this value to be the key in the JSON secret that contains the password for database connection. |`db_pass`|`password`|
28
31
29
32
> [!NOTE]
30
33
> A Secret ARN has the following format: `arn:aws:secretsmanager:<Region>:<AccountId>:secret:SecretName-6RandomCharacters`
31
34
32
35
## Secret Data
33
36
34
-
The plugin assumes that the secret contains the following properties `username` and `password`.
37
+
The secret stored in the AWS Secrets Manager should be a JSON object containing the properties `username` and `password`. If the secret contains different key names, you can specify them with the `secretUsernameProperty` and `secretPasswordProperty` parameters.
38
+
39
+
> [!NOTE]
40
+
> Only un-nested JSON format is supported at the moment.
@@ -29,7 +30,13 @@ const client = new AwsMySQLClient({
29
30
port: port,
30
31
secretId: secretId,
31
32
secretRegion: secretRegion,
32
-
plugins: "secretsManager"
33
+
secretExpirationSec: secretExpirationTime,
34
+
plugins: "secretsManager",
35
+
// By default, the Secrets Manager plugin assumes the secret stored in the AWS Secrets Manager to be a JSON object containing the properties `username` and `password`.
36
+
// If the secret contains different key names, you can specify them with the `secretUsernameProperty` and `secretPasswordProperty` parameters.
37
+
// This example assumes the credentials are stored under the keys db_user and db_pass.
0 commit comments