Cloud Keys 2020 Node.js Edition

Questions / Feedback?

CreateVersion Method

Creates a new secret version.


amazonsecrets.createVersion(secretId, stagingLabels, [callback])


The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

'err' has 2 properties which hold detailed information:



This method creates a new version of the secret specified by SecretId. The secret data is taken from the specified LocalFile or the SecretData or SecretString property; it may be up to 65536 bytes in length. The Id of the newly-created secret version is returned.

The value passed for SecretId must the ARN or name of a secret in the current account and Region.

The value passed for StagingLabels must be a comma-separated list of staging labels to attach to the new version; up to 20 staging labels can be attached to a secret version. If empty string is passed, AWSCURRENT is assumed. The server may do the following things depending on which staging labels are specified:

  • If any of the specified staging labels are currently attached to other versions of this secret, they are moved from those versions to the new one.
  • If the AWSCURRENT staging label is attached to the new version, the server will automatically move the AWSPREVIOUS staging label to the version that AWSCURRENT was previously attached to.

Copyright (c) 2022 /n software inc. - All rights reserved.
Cloud Keys 2020 Node.js Edition - Version 20.0 [Build 8157]