Class CfnRotationSchedule
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::SecretsManager::RotationSchedule.
Sets the rotation schedule and Lambda rotation function for a secret. For more information, see How rotation works .
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
For the rotation function, you have two options:
- You can create a new rotation function based on one of the Secrets Manager rotation function templates by using
HostedRotationLambda. - You can choose an existing rotation function by using
RotationLambdaARN.
For database secrets, if you define both the secret and the database or service in the AWS CloudFormation template, then you need to define the AWS::SecretsManager::SecretTargetAttachment resource to populate the secret with the connection details of the database or service before you attempt to configure rotation.
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();
-
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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnRotationSchedule(Construct scope, String id, CfnRotationScheduleProps props) Create a newAWS::SecretsManager::RotationSchedule.protectedCfnRotationSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRotationSchedule(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionCreates a new Lambda rotation function based on one of the Secrets Manager rotation function templates .Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.The ARN of an existing Lambda rotation function.A structure that defines the rotation configuration for this secret.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 .voidSpecifies whether to rotate the secret immediately or wait until the next scheduled rotation window.voidSpecifies whether to rotate the secret immediately or wait until the next scheduled rotation window.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.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods 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.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 Construct scope, @NotNull String id, @NotNull CfnRotationScheduleProps props) Create a newAWS::SecretsManager::RotationSchedule.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getSecretId
The ARN or name of the secret to rotate.To reference a secret also created in this template, use the Ref function with the secret's logical ID.
-
setSecretId
The ARN or name of the secret to rotate.To reference a secret also created in this template, use the Ref function with the secret's logical ID.
-
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.For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
-
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.For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
-
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.For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
-
getRotateImmediatelyOnUpdate
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.The rotation schedule is defined in
RotationRules.If you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the
testSecretstep of the Lambda rotation function. The test creates anAWSPENDINGversion of the secret and then removes it.If you don't specify this value, then by default, Secrets Manager rotates the secret immediately.
Rotation is an asynchronous process. For more information, see How rotation works .
-
setRotateImmediatelyOnUpdate
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.The rotation schedule is defined in
RotationRules.If you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the
testSecretstep of the Lambda rotation function. The test creates anAWSPENDINGversion of the secret and then removes it.If you don't specify this value, then by default, Secrets Manager rotates the secret immediately.
Rotation is an asynchronous process. For more information, see How rotation works .
-
setRotateImmediatelyOnUpdate
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.The rotation schedule is defined in
RotationRules.If you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the
testSecretstep of the Lambda rotation function. The test creates anAWSPENDINGversion of the secret and then removes it.If you don't specify this value, then by default, Secrets Manager rotates the secret immediately.
Rotation is an asynchronous process. For more information, see How rotation works .
-
getRotationLambdaArn
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 .
To create a new rotation function based on one of the Secrets Manager rotation function templates , specify
HostedRotationLambdainstead. -
setRotationLambdaArn
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 .
To create a new rotation function based on one of the Secrets Manager rotation function templates , specify
HostedRotationLambdainstead. -
getRotationRules
A structure that defines the rotation configuration for this secret. -
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.
-