@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.021Z") @Stability(value=Stable) 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 the rotation function, you have two options:
HostedRotationLambda .RotationLambdaARN .For Amazon RDS , Amazon Redshift , Amazon DocumentDB 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")
.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.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnRotationSchedule(software.constructs.Construct scope,
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 Map<String,Object> |
getCfnProperties() |
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) .
|
Object |
getRotateImmediatelyOnUpdate()
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
|
String |
getRotationLambdaArn()
The ARN of an existing Lambda rotation function.
|
Object |
getRotationRules()
A structure that defines the rotation configuration for this secret.
|
String |
getSecretId()
The ARN or name of the secret to rotate.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,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(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(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(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, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnRotationSchedule(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnRotationSchedule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnRotationSchedule(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public String getSecretId()
To reference a secret also created in this template, use the Ref function with the secret's logical ID.
@Stability(value=Stable)
public void setSecretId(@NotNull
String value)
To reference a secret also created in this template, use the Ref function with the secret's logical ID.
@Stability(value=Stable) @Nullable public Object getHostedRotationLambda()
@Stability(value=Stable)
public void setHostedRotationLambda(@Nullable
CfnRotationSchedule.HostedRotationLambdaProperty value)
@Stability(value=Stable)
public void setHostedRotationLambda(@Nullable
IResolvable value)
@Stability(value=Stable) @Nullable public 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.
@Stability(value=Stable)
public void setRotateImmediatelyOnUpdate(@Nullable
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.
@Stability(value=Stable)
public void setRotateImmediatelyOnUpdate(@Nullable
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.
@Stability(value=Stable) @Nullable public String getRotationLambdaArn()
To specify a rotation function that is also defined in this template, use the Ref function.
To create a new rotation function based on one of the Secrets Manager rotation function templates , specify HostedRotationLambda instead.
@Stability(value=Stable)
public void setRotationLambdaArn(@Nullable
String value)
To specify a rotation function that is also defined in this template, use the Ref function.
To create a new rotation function based on one of the Secrets Manager rotation function templates , specify HostedRotationLambda instead.
@Stability(value=Stable) @Nullable public Object getRotationRules()
@Stability(value=Stable)
public void setRotationRules(@Nullable
CfnRotationSchedule.RotationRulesProperty value)
@Stability(value=Stable)
public void setRotationRules(@Nullable
IResolvable value)
Copyright © 2022. All rights reserved.