Skip to content

PutSecretValue

Source: src/AWS/SecretsManager/PutSecretValue.ts

Runtime binding for secretsmanager:PutSecretValue.

Bind this operation to a Secret to get a callable that writes a new secret version (string or binary); the new version becomes AWSCURRENT. Provide the implementation with Effect.provide(AWS.SecretsManager.PutSecretValueHttp).

Rotate a Secret’s Value

// init — bind the operation to the secret
const putSecretValue = yield* AWS.SecretsManager.PutSecretValue(secret);
// runtime — write a new version; the response carries its VersionId
const result = yield* putSecretValue({
SecretString: newPassword,
});

Store a Binary Payload

yield* putSecretValue({
SecretBinary: new TextEncoder().encode(JSON.stringify(credentials)),
});