CfnRotationScheduleProps Struct
Properties for defining a CfnRotationSchedule.
| Source | |
|---|---|
| Type last changed |
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
externalSecretRotationMetadata: [{
key: 'key',
value: 'value',
}],
externalSecretRotationRoleArn: 'externalSecretRotationRoleArn',
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',
},
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_secretsmanager as secretsmanager
cfn_rotation_schedule_props = secretsmanager.CfnRotationScheduleProps(
secret_id="secretId",
# the properties below are optional
external_secret_rotation_metadata=[secretsmanager.CfnRotationSchedule.ExternalSecretRotationMetadataItemProperty(
key="key",
value="value"
)],
external_secret_rotation_role_arn="externalSecretRotationRoleArn",
hosted_rotation_lambda=secretsmanager.CfnRotationSchedule.HostedRotationLambdaProperty(
rotation_type="rotationType",
# the properties below are optional
exclude_characters="excludeCharacters",
kms_key_arn="kmsKeyArn",
master_secret_arn="masterSecretArn",
master_secret_kms_key_arn="masterSecretKmsKeyArn",
rotation_lambda_name="rotationLambdaName",
runtime="runtime",
superuser_secret_arn="superuserSecretArn",
superuser_secret_kms_key_arn="superuserSecretKmsKeyArn",
vpc_security_group_ids="vpcSecurityGroupIds",
vpc_subnet_ids="vpcSubnetIds"
),
rotate_immediately_on_update=False,
rotation_lambda_arn="rotationLambdaArn",
rotation_rules=secretsmanager.CfnRotationSchedule.RotationRulesProperty(
automatically_after_days=123,
duration="duration",
schedule_expression="scheduleExpression"
)
)
// 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.*;
CfnRotationScheduleProps cfnRotationScheduleProps = CfnRotationScheduleProps.builder()
.secretId("secretId")
// the properties below are optional
.externalSecretRotationMetadata(List.of(ExternalSecretRotationMetadataItemProperty.builder()
.key("key")
.value("value")
.build()))
.externalSecretRotationRoleArn("externalSecretRotationRoleArn")
.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();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SecretsManager;
var cfnRotationScheduleProps = new CfnRotationScheduleProps {
SecretId = "secretId",
// the properties below are optional
ExternalSecretRotationMetadata = new [] { new ExternalSecretRotationMetadataItemProperty {
Key = "key",
Value = "value"
} },
ExternalSecretRotationRoleArn = "externalSecretRotationRoleArn",
HostedRotationLambda = new HostedRotationLambdaProperty {
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 = new RotationRulesProperty {
AutomaticallyAfterDays = 123,
Duration = "duration",
ScheduleExpression = "scheduleExpression"
}
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnRotationScheduleProps := &CfnRotationScheduleProps{
SecretId: jsii.String("secretId"),
// the properties below are optional
ExternalSecretRotationMetadata: []interface{}{
&ExternalSecretRotationMetadataItemProperty{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
ExternalSecretRotationRoleArn: jsii.String("externalSecretRotationRoleArn"),
HostedRotationLambda: &HostedRotationLambdaProperty{
RotationType: jsii.String("rotationType"),
// the properties below are optional
ExcludeCharacters: jsii.String("excludeCharacters"),
KmsKeyArn: jsii.String("kmsKeyArn"),
MasterSecretArn: jsii.String("masterSecretArn"),
MasterSecretKmsKeyArn: jsii.String("masterSecretKmsKeyArn"),
RotationLambdaName: jsii.String("rotationLambdaName"),
Runtime: jsii.String("runtime"),
SuperuserSecretArn: jsii.String("superuserSecretArn"),
SuperuserSecretKmsKeyArn: jsii.String("superuserSecretKmsKeyArn"),
VpcSecurityGroupIds: jsii.String("vpcSecurityGroupIds"),
VpcSubnetIds: jsii.String("vpcSubnetIds"),
},
RotateImmediatelyOnUpdate: jsii.Boolean(false),
RotationLambdaArn: jsii.String("rotationLambdaArn"),
RotationRules: &RotationRulesProperty{
AutomaticallyAfterDays: jsii.Number(123),
Duration: jsii.String("duration"),
ScheduleExpression: jsii.String("scheduleExpression"),
},
}
Properties
externalSecretRotationMetadataoptionalIResolvable | IResolvable | CfnRotationSchedule.external_secret_rotation_metadataoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ExternalSecretRotationMetadataItemProperty]]]externalSecretRotationMetadataoptionalIResolvableExternalSecretRotationMetadataoptionalIResolvableExternalSecretRotationMetadataoptionalinterface{} #externalSecretRotationRoleArnoptionalstringexternal_secret_rotation_role_arnoptionalstrexternalSecretRotationRoleArnoptionalStringExternalSecretRotationRoleArnoptionalstringExternalSecretRotationRoleArnoptional*string #hostedRotationLambdaoptionalIResolvable | CfnRotationSchedule.hosted_rotation_lambdaoptionaltyping.Union[IResolvable, HostedRotationLambdaProperty]hostedRotationLambdaoptionalIResolvableHostedRotationLambdaoptionalIResolvableHostedRotationLambdaoptionalinterface{} #notes
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 .
rotateImmediatelyOnUpdateoptionalboolean | IResolvablerotate_immediately_on_updateoptionaltyping.Union[bool, IResolvable]rotateImmediatelyOnUpdateoptionalBooleanRotateImmediatelyOnUpdateoptionalboolRotateImmediatelyOnUpdateoptionalinterface{} #notes
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 .
rotationLambdaArnoptionalstringrotation_lambda_arnoptionalstrrotationLambdaArnoptionalStringRotationLambdaArnoptionalstringRotationLambdaArnoptional*string #notes
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.
rotationRulesoptionalIResolvable | CfnRotationSchedule.rotation_rulesoptionaltyping.Union[IResolvable, RotationRulesProperty]rotationRulesoptionalIResolvableRotationRulesoptionalIResolvableRotationRulesoptionalinterface{} #