Class: AWS.SecretsManager

Identifier:
SecretsManager
API Version:
2018-11-26
Defined in:
secretsmanager.js

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Constructor Summary collapse

Method Summary collapse

Constructor Details

new GG.SecretsManager() ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a SecretsManager object

var secretsmanager = new GG.SecretsManager();

Method Details

getSecretValue(params = {}, callback)

Retrieves a specific local secret value.

Examples:

Retrieving a local secret value


/* This operation retrieves a local secret value */

 var params = {
   SecretId: "STRING_VALUE", 
   VersionStage: "STRING_VALUE"
 };
 secretsmanager.getSecretValue(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
 });

Parameters:

  • params (Object) (defaults to: {})
    • SecretId — (String)

      Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

    • VersionStage — (String)

      Specifies the secret version that you want to retrieve by the staging label attached to the version.

      Staging labels are used to keep track of different versions during the rotation process.

Callback(callback):

  • function(err, data) { ... }

    Called when a response from the service is returned.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ARN — (String)

        The ARN of the secret.

      • Name — (String)

        The friendly name of the secret.

      • VersionId — (String)

        The unique identifier of this version of the secret.

      • SecretBinary — (Buffer, Typed Array, Blob, String)

        The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. The response parameter represents the binary data as a base64-encoded string.

      • SecretString — (String)

        The decrypted part of the protected secret information that was originally provided as a string.

      • VersionStages — (Array<String>)

        Specifies the secret version that you want to retrieve by the staging label attached to the version.

        Staging labels are used to keep track of different versions during the rotation process.

Returns:

  • Nothing