AWS Secrets Manager Plugin

January 15, 2026 ยท View on GitHub

The AWS Advanced NodeJS Wrapper supports usage of database credentials stored as secrets in the AWS Secrets Manager through the AWS Secrets Manager Connection Plugin. When you create a new connection with this plugin enabled, the plugin will retrieve the secret and the connection will be created with the credentials inside that secret.

Prerequisites

Enabling the AWS Secrets Manager Connection Plugin

To enable the AWS Secrets Manager Connection Plugin, add the plugin code secretsManager to the plugins connection parameter.

This plugin requires a valid set of AWS credentials to retrieve the database credentials from AWS Secrets Manager. The AWS credentials must be located in one of these locations supported by the AWS SDK's default credentials provider. See also at AWS Credentials Configuration

AWS Secrets Manager Connection Plugin Parameters

The following properties are required for the AWS Secrets Manager Connection Plugin to retrieve database credentials from the AWS Secrets Manager.

Note


To use this plugin, you will need to set the following AWS Secrets Manager specific parameters.

ParameterValueRequiredDescriptionExampleDefault Value
secretIdStringYesSet this value to be the secret name or the secret ARN.secretIdnull
secretRegionStringYes unless the secretId is an ARNSet this value to be the region your secret is in.us-east-2null
secretEndpointStringNoSet 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:1234null
secretExpirationSecIntegerNoThis property sets the time in seconds that secrets are cached before it is re-fetched.600870
secretUsernamePropertyStringNoSet this value to be the key in the JSON secret that contains the username for database connection.db_userusername
secretPasswordPropertyStringNoSet this value to be the key in the JSON secret that contains the password for database connection.db_passpassword

Note


A Secret ARN has the following format: arn:aws:secretsmanager:<Region>:<AccountId>:secret:SecretName-6RandomCharacters

Secret Data

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.

Note

Only un-nested JSON format is supported at the moment.

Example

Examples of making a connection using credentials fetched from the AWS Secrets Manager can be found at: PostgreSQL example and MySQL example