@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:44.571Z") public class CfnRotationSchedule extends CfnResource implements IInspectable
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:
HostedRotationLambda
.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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnRotationSchedule.Builder
A fluent builder for
CfnRotationSchedule . |
static interface |
CfnRotationSchedule.HostedRotationLambdaProperty
Creates a new Lambda rotation function based on one of the [Secrets Manager rotation function templates](https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_available-rotation-templates.html) .
|
static interface |
CfnRotationSchedule.RotationRulesProperty
The rotation schedule and window.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnRotationSchedule(Construct scope,
java.lang.String id,
CfnRotationScheduleProps props)
Create a new `AWS::SecretsManager::RotationSchedule`.
|
protected |
CfnRotationSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnRotationSchedule(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getHostedRotationLambda()
Creates a new Lambda rotation function based on one of the [Secrets Manager rotation function templates](https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_available-rotation-templates.html) .
|
java.lang.Object |
getRotateImmediatelyOnUpdate()
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
|
java.lang.String |
getRotationLambdaArn()
The ARN of an existing Lambda rotation function.
|
java.lang.Object |
getRotationRules()
A structure that defines the rotation configuration for this secret.
|
java.lang.String |
getSecretId()
The ARN or name of the secret to rotate.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setHostedRotationLambda(CfnRotationSchedule.HostedRotationLambdaProperty value)
Creates a new Lambda rotation function based on one of the [Secrets Manager rotation function templates](https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_available-rotation-templates.html) .
|
void |
setHostedRotationLambda(IResolvable value)
Creates a new Lambda rotation function based on one of the [Secrets Manager rotation function templates](https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_available-rotation-templates.html) .
|
void |
setRotateImmediatelyOnUpdate(java.lang.Boolean value)
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
|
void |
setRotateImmediatelyOnUpdate(IResolvable value)
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
|
void |
setRotationLambdaArn(java.lang.String value)
The ARN of an existing Lambda rotation function.
|
void |
setRotationRules(CfnRotationSchedule.RotationRulesProperty value)
A structure that defines the rotation configuration for this secret.
|
void |
setRotationRules(IResolvable value)
A structure that defines the rotation configuration for this secret.
|
void |
setSecretId(java.lang.String value)
The ARN or name of the secret to rotate.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnRotationSchedule(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnRotationSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnRotationSchedule(Construct scope, java.lang.String id, CfnRotationScheduleProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.String getSecretId()
To reference a secret also created in this template, use the Ref function with the secret's logical ID.
public void setSecretId(java.lang.String value)
To reference a secret also created in this template, use the Ref function with the secret's logical ID.
public java.lang.Object getHostedRotationLambda()
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
public void setHostedRotationLambda(CfnRotationSchedule.HostedRotationLambdaProperty value)
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
public void setHostedRotationLambda(IResolvable value)
For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .
public java.lang.Object getRotateImmediatelyOnUpdate()
The rotation schedule is defined in RotationRules
.
If you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the testSecret
step of the Lambda rotation function. The test creates an AWSPENDING
version 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 .
public void setRotateImmediatelyOnUpdate(java.lang.Boolean value)
The rotation schedule is defined in RotationRules
.
If you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the testSecret
step of the Lambda rotation function. The test creates an AWSPENDING
version 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 .
public void setRotateImmediatelyOnUpdate(IResolvable value)
The rotation schedule is defined in RotationRules
.
If you don't immediately rotate the secret, Secrets Manager tests the rotation configuration by running the testSecret
step of the Lambda rotation function. The test creates an AWSPENDING
version 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 .
public java.lang.String getRotationLambdaArn()
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 HostedRotationLambda
instead.
public void setRotationLambdaArn(java.lang.String value)
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 HostedRotationLambda
instead.
public java.lang.Object getRotationRules()
public void setRotationRules(IResolvable value)
public void setRotationRules(CfnRotationSchedule.RotationRulesProperty value)