aws-cdk-lib.aws_secretsmanager.RotationScheduleOptions

interface RotationScheduleOptions

LanguageType name
.NETAmazon.CDK.AWS.SecretsManager.RotationScheduleOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awssecretsmanager#RotationScheduleOptions
Javasoftware.amazon.awscdk.services.secretsmanager.RotationScheduleOptions
Pythonaws_cdk.aws_secretsmanager.RotationScheduleOptions
TypeScript (source)aws-cdk-lib » aws_secretsmanager » RotationScheduleOptions

Options to add a rotation schedule to a secret.

Example

import * as lambda from 'aws-cdk-lib/aws-lambda';

declare const fn: lambda.Function;
const secret = new secretsmanager.Secret(this, 'Secret');

secret.addRotationSchedule('RotationSchedule', {
  rotationLambda: fn,
  automaticallyAfter: Duration.days(15),
});

Properties

NameTypeDescription
automaticallyAfter?DurationSpecifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.
hostedRotation?HostedRotationHosted rotation.
rotateImmediatelyOnUpdate?booleanSpecifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
rotationLambda?IFunctionA Lambda function that can rotate the secret.

automaticallyAfter?

Type: Duration (optional, default: Duration.days(30))

Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

A value of zero will disable automatic rotation - Duration.days(0).


hostedRotation?

Type: HostedRotation (optional, default: either rotationLambda or hostedRotation must be specified)

Hosted rotation.


rotateImmediatelyOnUpdate?

Type: boolean (optional, default: secret is rotated immediately)

Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.


rotationLambda?

Type: IFunction (optional, default: either rotationLambda or hostedRotation must be specified)

A Lambda function that can rotate the secret.