Class: SecretsManager

aws-greengrass-core-sdk~SecretsManager()

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

Constructor

new SecretsManager()

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

Constructing a SecretsManager object

var secretsmanager = new GG.SecretsManager();

Methods

getSecretValue(params, callback)

Retrieves a specific local secret value.
Parameters:
Name Type Description
params Object
Properties
Name Type Description
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.
DeStringifyResultFlag boolean Optional Flag to decide the return type from getSecretValue. If set, it returns de-serialized data object, otherwise it returns stringified response.
callback secretsManagerCallback The callback.
Source:
Example

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
});