Class CfnRotationSchedule
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.secretsmanager.CfnRotationSchedule
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IRotationScheduleRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:14.088Z")
@Stability(Stable)
public class CfnRotationSchedule
extends CfnResource
implements IInspectable, IRotationScheduleRef
Configure the rotation schedule and Lambda rotation function for a secret. For more information, see How rotation works .
For database credentials, refer to the following resources:
- Amazon RDS master user credentials: AWS::RDS::DBCluster MasterUserSecret
- Amazon Redshift admin user credentials: AWS::Redshift::Cluster
Choose one of the following options for the rotation function:
- Create a new rotation function using
HostedRotationLambdabased on a Secrets Manager rotation function template . - Use an existing rotation function by specifying its ARN with
RotationLambdaARN.
For database secrets defined in the same AWS CloudFormation template as the database or service:
- Use the AWS::SecretsManager::SecretTargetAttachment resource to populate the secret with connection details.
- Add a
DependsOnattribute to theRotationScheduleresource that uses aSecretTargetAttachment. This ensures the rotation is configured after the secret is populated with connection details. > You can define only one rotation schedule per secret.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.secretsmanager.*;
CfnRotationSchedule cfnRotationSchedule = CfnRotationSchedule.Builder.create(this, "MyCfnRotationSchedule")
.secretId("secretId")
// the properties below are optional
.hostedRotationLambda(HostedRotationLambdaProperty.builder()
.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")
.build())
.rotateImmediatelyOnUpdate(false)
.rotationLambdaArn("rotationLambdaArn")
.rotationRules(RotationRulesProperty.builder()
.automaticallyAfterDays(123)
.duration("duration")
.scheduleExpression("scheduleExpression")
.build())
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnRotationSchedule.static interfaceCreates a new Lambda rotation function based on one of the Secrets Manager rotation function templates .static interfaceThe rotation schedule and window.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.secretsmanager.IRotationScheduleRef
IRotationScheduleRef.Jsii$Default, IRotationScheduleRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnRotationSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRotationSchedule(software.amazon.jsii.JsiiObjectRef objRef) CfnRotationSchedule(software.constructs.Construct scope, String id, CfnRotationScheduleProps props) Create a newAWS::SecretsManager::RotationSchedule. -
Method Summary
Modifier and TypeMethodDescriptionThe ARN of the secret.Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates .Determines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated.The ARN of an existing Lambda rotation function.A structure that defines the rotation configuration for this secret.A reference to a RotationSchedule resource.The ARN or name of the secret to rotate.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidCreates a new Lambda rotation function based on one of the Secrets Manager rotation function templates .voidCreates a new Lambda rotation function based on one of the Secrets Manager rotation function templates .voidDetermines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated.voidDetermines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated.voidsetRotationLambdaArn(String value) The ARN of an existing Lambda rotation function.voidsetRotationRules(IResolvable value) A structure that defines the rotation configuration for this secret.voidA structure that defines the rotation configuration for this secret.voidsetSecretId(String value) The ARN or name of the secret to rotate.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnRotationSchedule
protected CfnRotationSchedule(software.amazon.jsii.JsiiObjectRef objRef) -
CfnRotationSchedule
protected CfnRotationSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnRotationSchedule
@Stability(Stable) public CfnRotationSchedule(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnRotationScheduleProps props) Create a newAWS::SecretsManager::RotationSchedule.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
The ARN of the secret. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getRotationScheduleRef
A reference to a RotationSchedule resource.- Specified by:
getRotationScheduleRefin interfaceIRotationScheduleRef
-
getSecretId
The ARN or name of the secret to rotate.This is unique for each rotation schedule definition.
-
setSecretId
The ARN or name of the secret to rotate.This is unique for each rotation schedule definition.
-
getHostedRotationLambda
Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates . To use a rotation function that already exists, specifyRotationLambdaARNinstead.Returns union: either
IResolvableorCfnRotationSchedule.HostedRotationLambdaProperty -
setHostedRotationLambda
Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates . To use a rotation function that already exists, specifyRotationLambdaARNinstead. -
setHostedRotationLambda
@Stability(Stable) public void setHostedRotationLambda(@Nullable CfnRotationSchedule.HostedRotationLambdaProperty value) Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates . To use a rotation function that already exists, specifyRotationLambdaARNinstead. -
getRotateImmediatelyOnUpdate
Determines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated.Returns union: either
BooleanorIResolvable -
setRotateImmediatelyOnUpdate
Determines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated. -
setRotateImmediatelyOnUpdate
Determines whether to rotate the secret immediately or wait until the next scheduled rotation window when the rotation schedule is updated. -
getRotationLambdaArn
The ARN of an existing Lambda rotation function. -
setRotationLambdaArn
The ARN of an existing Lambda rotation function. -
getRotationRules
A structure that defines the rotation configuration for this secret.Returns union: either
IResolvableorCfnRotationSchedule.RotationRulesProperty -
setRotationRules
A structure that defines the rotation configuration for this secret. -
setRotationRules
@Stability(Stable) public void setRotationRules(@Nullable CfnRotationSchedule.RotationRulesProperty value) A structure that defines the rotation configuration for this secret.
-