interface CfnRotationScheduleProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.SecretsManager.CfnRotationScheduleProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awssecretsmanager#CfnRotationScheduleProps |
Java | software.amazon.awscdk.services.secretsmanager.CfnRotationScheduleProps |
Python | aws_cdk.aws_secretsmanager.CfnRotationScheduleProps |
TypeScript | aws-cdk-lib » aws_secretsmanager » CfnRotationScheduleProps |
Properties for defining a CfnRotationSchedule.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';
const cfnRotationScheduleProps: secretsmanager.CfnRotationScheduleProps = {
secretId: 'secretId',
// the properties below are optional
hostedRotationLambda: {
rotationType: 'rotationType',
// the properties below are optional
excludeCharacters: 'excludeCharacters',
kmsKeyArn: 'kmsKeyArn',
masterSecretArn: 'masterSecretArn',
masterSecretKmsKeyArn: 'masterSecretKmsKeyArn',
rotationLambdaName: 'rotationLambdaName',
runtime: 'runtime',
superuserSecretArn: 'superuserSecretArn',
superuserSecretKmsKeyArn: 'superuserSecretKmsKeyArn',
vpcSecurityGroupIds: 'vpcSecurityGroupIds',
vpcSubnetIds: 'vpcSubnetIds',
},
rotateImmediatelyOnUpdate: false,
rotationLambdaArn: 'rotationLambdaArn',
rotationRules: {
automaticallyAfterDays: 123,
duration: 'duration',
scheduleExpression: 'scheduleExpression',
},
};
Properties
| Name | Type | Description |
|---|---|---|
| secret | string | The ARN or name of the secret to rotate. This is unique for each rotation schedule definition. |
| hosted | IResolvable | Hosted | Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates . To use a rotation function that already exists, specify RotationLambdaARN instead. |
| rotate | boolean | IResolvable | Determines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated. |
| rotation | string | The ARN of an existing Lambda rotation function. |
| rotation | IResolvable | Rotation | A structure that defines the rotation configuration for this secret. |
secretId
Type:
string
The ARN or name of the secret to rotate. This is unique for each rotation schedule definition.
To reference a secret also created in this template, use the Ref function with the secret's logical ID.
hostedRotationLambda?
Type:
IResolvable | Hosted
(optional)
Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates . To use a rotation function that already exists, specify RotationLambdaARN instead.
You must specify Transform: AWS::SecretsManager-2024-09-16 at the beginning of the CloudFormation template. Transforms are macros hosted by AWS CloudFormation that help you create and manage complex infrastructure. The Transform: AWS::SecretsManager-2024-09-16 transform automatically extends the CloudFormation stack to include a nested stack (of type AWS::CloudFormation::Stack ), which then creates and updates on your behalf during subsequent stack operations, the appropriate rotation Lambda function for your database or service. For general information on transforms, see the AWS CloudFormation documentation.
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
For Amazon Redshift admin user credentials, see AWS::Redshift::Cluster .
rotateImmediatelyOnUpdate?
Type:
boolean | IResolvable
(optional)
Determines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated.
The rotation schedule is defined in RotationRules .
The default for RotateImmediatelyOnUpdate is true . If you don't specify this value, Secrets Manager rotates the secret immediately.
If you set RotateImmediatelyOnUpdate to false , Secrets Manager tests the rotation configuration by running the testSecret step of the Lambda rotation function. This test creates an AWSPENDING version of the secret and then removes it.
When changing an existing rotation schedule and setting
RotateImmediatelyOnUpdatetofalse:
- If using
AutomaticallyAfterDaysor aScheduleExpressionwithrate(), the previously scheduled rotation might still occur.- To prevent unintended rotations, use a
ScheduleExpressionwithcron()for granular control over rotation windows.
Rotation is an asynchronous process. For more information, see How rotation works .
rotationLambdaArn?
Type:
string
(optional)
The ARN of an existing Lambda rotation function.
To specify a rotation function that is also defined in this template, use the Ref function.
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
For Amazon Redshift admin user credentials, see AWS::Redshift::Cluster .
To create a new rotation function based on one of the Secrets Manager rotation function templates , specify HostedRotationLambda instead.
rotationRules?
Type:
IResolvable | Rotation
(optional)
A structure that defines the rotation configuration for this secret.

.NET
Go
Java
Python
TypeScript