Skip to content

RotateSecret

Source: src/AWS/SecretsManager/RotateSecret.ts

Runtime binding for secretsmanager:RotateSecret.

Bind this operation to a Secret to get a callable that triggers an immediate rotation using the secret’s configured rotation function (see onSecretRotation for wiring one up). Provide the implementation with Effect.provide(AWS.SecretsManager.RotateSecretHttp).

// init — bind the operation to the secret
const rotateSecret = yield* AWS.SecretsManager.RotateSecret(secret);
// runtime — kicks off the configured rotation function
const result = yield* rotateSecret();
const pendingVersionId = result.VersionId;