CfnRotationSchedulePropsMixin

class aws_cdk.mixins_preview.aws_secretsmanager.mixins.CfnRotationSchedulePropsMixin(props, *, strategy=None)

Bases: Mixin

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:

Choose one of the following options for the rotation function:

For database secrets defined in the same CloudFormation template as the database or service:

  • Use the AWS::SecretsManager::SecretTargetAttachment resource to populate the secret with connection details.

  • Add a DependsOn attribute to the RotationSchedule resource that uses a SecretTargetAttachment . This ensures the rotation is configured after the secret is populated with connection details. > You can define only one rotation schedule per secret.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-secretsmanager-rotationschedule.html

CloudformationResource:

AWS::SecretsManager::RotationSchedule

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_secretsmanager import mixins as secretsmanager_mixins

cfn_rotation_schedule_props_mixin = secretsmanager_mixins.CfnRotationSchedulePropsMixin(secretsmanager_mixins.CfnRotationScheduleMixinProps(
    external_secret_rotation_metadata=[secretsmanager_mixins.CfnRotationSchedulePropsMixin.ExternalSecretRotationMetadataItemProperty(
        key="key",
        value="value"
    )],
    external_secret_rotation_role_arn="externalSecretRotationRoleArn",
    hosted_rotation_lambda=secretsmanager_mixins.CfnRotationSchedulePropsMixin.HostedRotationLambdaProperty(
        exclude_characters="excludeCharacters",
        kms_key_arn="kmsKeyArn",
        master_secret_arn="masterSecretArn",
        master_secret_kms_key_arn="masterSecretKmsKeyArn",
        rotation_lambda_name="rotationLambdaName",
        rotation_type="rotationType",
        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_mixins.CfnRotationSchedulePropsMixin.RotationRulesProperty(
        automatically_after_days=123,
        duration="duration",
        schedule_expression="scheduleExpression"
    ),
    secret_id="secretId"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::SecretsManager::RotationSchedule.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['externalSecretRotationMetadata', 'externalSecretRotationRoleArn', 'hostedRotationLambda', 'rotateImmediatelyOnUpdate', 'rotationLambdaArn', 'rotationRules', 'secretId']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ExternalSecretRotationMetadataItemProperty

class CfnRotationSchedulePropsMixin.ExternalSecretRotationMetadataItemProperty(*, key=None, value=None)

Bases: object

The metadata needed to successfully rotate a managed external secret.

A list of key value pairs in JSON format specified by the partner. For more information, see Managed external secret partners .

Parameters:
  • key (Optional[str]) – The key that identifies the item.

  • value (Optional[str]) – The value of the specified item.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-externalsecretrotationmetadataitem.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_secretsmanager import mixins as secretsmanager_mixins

external_secret_rotation_metadata_item_property = secretsmanager_mixins.CfnRotationSchedulePropsMixin.ExternalSecretRotationMetadataItemProperty(
    key="key",
    value="value"
)

Attributes

key

The key that identifies the item.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-externalsecretrotationmetadataitem.html#cfn-secretsmanager-rotationschedule-externalsecretrotationmetadataitem-key

value

The value of the specified item.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-externalsecretrotationmetadataitem.html#cfn-secretsmanager-rotationschedule-externalsecretrotationmetadataitem-value

HostedRotationLambdaProperty

class CfnRotationSchedulePropsMixin.HostedRotationLambdaProperty(*, exclude_characters=None, kms_key_arn=None, master_secret_arn=None, master_secret_kms_key_arn=None, rotation_lambda_name=None, rotation_type=None, runtime=None, superuser_secret_arn=None, superuser_secret_kms_key_arn=None, vpc_security_group_ids=None, vpc_subnet_ids=None)

Bases: object

Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates .

You must specify Transform: AWS::SecretsManager-2024-09-16 at the beginning of the CloudFormation template.

For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .

For Amazon Redshift admin user credentials, see AWS::Redshift::Cluster .

Parameters:
  • exclude_characters (Optional[str]) – A string of the characters that you don’t want in the password.

  • kms_key_arn (Optional[str]) – The ARN of the KMS key that Secrets Manager uses to encrypt the secret. If you don’t specify this value, then Secrets Manager uses the key aws/secretsmanager . If aws/secretsmanager doesn’t yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.

  • master_secret_arn (Optional[str]) – The ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager . You must create the superuser secret before you can set this property. You must also include the superuser secret ARN as a key in the JSON of the rotating secret so that the Lambda rotation function can find it. CloudFormation does not hardcode secret ARNs in the Lambda rotation function, so you can use the function to rotate multiple secrets. For more information, see JSON structure of Secrets Manager secrets . You can specify MasterSecretArn or SuperuserSecretArn but not both. They represent the same superuser secret.

  • master_secret_kms_key_arn (Optional[str]) –

    The ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don’t need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager . You can specify MasterSecretKmsKeyArn or SuperuserSecretKmsKeyArn but not both. They represent the same superuser secret KMS key .

  • rotation_lambda_name (Optional[str]) – The name of the Lambda rotation function.

  • rotation_type (Optional[str]) – The rotation template to base the rotation function on, one of the following:. - Db2SingleUser to use the template SecretsManagerRDSDb2RotationSingleUser . - Db2MultiUser to use the template SecretsManagerRDSDb2RotationMultiUser . - MySQLSingleUser to use the template SecretsManagerRDSMySQLRotationSingleUser . - MySQLMultiUser to use the template SecretsManagerRDSMySQLRotationMultiUser . - PostgreSQLSingleUser to use the template SecretsManagerRDSPostgreSQLRotationSingleUser - PostgreSQLMultiUser to use the template SecretsManagerRDSPostgreSQLRotationMultiUser . - OracleSingleUser to use the template SecretsManagerRDSOracleRotationSingleUser . - OracleMultiUser to use the template SecretsManagerRDSOracleRotationMultiUser . - MariaDBSingleUser to use the template SecretsManagerRDSMariaDBRotationSingleUser . - MariaDBMultiUser to use the template SecretsManagerRDSMariaDBRotationMultiUser . - SQLServerSingleUser to use the template SecretsManagerRDSSQLServerRotationSingleUser . - SQLServerMultiUser to use the template SecretsManagerRDSSQLServerRotationMultiUser . - RedshiftSingleUser to use the template SecretsManagerRedshiftRotationSingleUsr . - RedshiftMultiUser to use the template SecretsManagerRedshiftRotationMultiUser . - MongoDBSingleUser to use the template SecretsManagerMongoDBRotationSingleUser . - MongoDBMultiUser to use the template SecretsManagerMongoDBRotationMultiUser .

  • runtime (Optional[str]) –

    Do not set this value if you are using Transform: AWS::SecretsManager-2024-09-16 . Over time, the updated rotation lambda artifacts vended by AWS may not be compatible with the code or shared object files defined in the rotation function deployment package. .. epigraph:: Only define the Runtime key if: - You are using Transform: AWS::SecretsManager-2020-07-23 . - The code or shared object files defined in the rotation function deployment package are incompatible with Python 3.10. The Python Runtime version for with the rotation function. By default, CloudFormation deploys Python 3.10 binaries for the rotation function. To use a different version of Python, you must do the following two steps: - Deploy the matching version Python binaries with your rotation function. - Set the version number in this field. For example, for Python 3.10, enter python3.10 . If you only do one of the steps, your rotation function will be incompatible with the binaries. For more information, see Why did my Lambda rotation function fail with a “pg module not found” error .

  • superuser_secret_arn (Optional[str]) –

    The ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager . You must create the superuser secret before you can set this property. You must also include the superuser secret ARN as a key in the JSON of the rotating secret so that the Lambda rotation function can find it. CloudFormation does not hardcode secret ARNs in the Lambda rotation function, so you can use the function to rotate multiple secrets. For more information, see JSON structure of Secrets Manager secrets . You can specify MasterSecretArn or SuperuserSecretArn but not both. They represent the same superuser secret.

  • superuser_secret_kms_key_arn (Optional[str]) –

    The ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don’t need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager . You can specify MasterSecretKmsKeyArn or SuperuserSecretKmsKeyArn but not both. They represent the same superuser secret KMS key .

  • vpc_security_group_ids (Optional[str]) – A comma-separated list of security group IDs applied to the target database. The template applies the same security groups as on the Lambda rotation function that is created as part of this stack.

  • vpc_subnet_ids (Optional[str]) – A comma separated list of VPC subnet IDs of the target database network. The Lambda rotation function is in the same subnet group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_secretsmanager import mixins as secretsmanager_mixins

hosted_rotation_lambda_property = secretsmanager_mixins.CfnRotationSchedulePropsMixin.HostedRotationLambdaProperty(
    exclude_characters="excludeCharacters",
    kms_key_arn="kmsKeyArn",
    master_secret_arn="masterSecretArn",
    master_secret_kms_key_arn="masterSecretKmsKeyArn",
    rotation_lambda_name="rotationLambdaName",
    rotation_type="rotationType",
    runtime="runtime",
    superuser_secret_arn="superuserSecretArn",
    superuser_secret_kms_key_arn="superuserSecretKmsKeyArn",
    vpc_security_group_ids="vpcSecurityGroupIds",
    vpc_subnet_ids="vpcSubnetIds"
)

Attributes

exclude_characters

A string of the characters that you don’t want in the password.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-excludecharacters

kms_key_arn

The ARN of the KMS key that Secrets Manager uses to encrypt the secret.

If you don’t specify this value, then Secrets Manager uses the key aws/secretsmanager . If aws/secretsmanager doesn’t yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-kmskeyarn

master_secret_arn

The ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You must create the superuser secret before you can set this property.

You must also include the superuser secret ARN as a key in the JSON of the rotating secret so that the Lambda rotation function can find it. CloudFormation does not hardcode secret ARNs in the Lambda rotation function, so you can use the function to rotate multiple secrets. For more information, see JSON structure of Secrets Manager secrets .

You can specify MasterSecretArn or SuperuserSecretArn but not both. They represent the same superuser secret.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-mastersecretarn

master_secret_kms_key_arn

The ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don’t need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You can specify MasterSecretKmsKeyArn or SuperuserSecretKmsKeyArn but not both. They represent the same superuser secret KMS key .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-mastersecretkmskeyarn

rotation_lambda_name

The name of the Lambda rotation function.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-rotationlambdaname

rotation_type

.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-rotationtype

Type:

The rotation template to base the rotation function on, one of the following

runtime

Do not set this value if you are using Transform: AWS::SecretsManager-2024-09-16 .

Over time, the updated rotation lambda artifacts vended by AWS may not be compatible with the code or shared object files defined in the rotation function deployment package. .. epigraph:

Only define the ``Runtime`` key if:

- You are using ``Transform: AWS::SecretsManager-2020-07-23`` .
- The code or shared object files defined in the rotation function deployment package are incompatible with Python 3.10.

The Python Runtime version for with the rotation function. By default, CloudFormation deploys Python 3.10 binaries for the rotation function. To use a different version of Python, you must do the following two steps:

  • Deploy the matching version Python binaries with your rotation function.

  • Set the version number in this field. For example, for Python 3.10, enter python3.10 .

If you only do one of the steps, your rotation function will be incompatible with the binaries. For more information, see Why did my Lambda rotation function fail with a “pg module not found” error .

see:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-runtime

superuser_secret_arn

The ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You must create the superuser secret before you can set this property.

You must also include the superuser secret ARN as a key in the JSON of the rotating secret so that the Lambda rotation function can find it. CloudFormation does not hardcode secret ARNs in the Lambda rotation function, so you can use the function to rotate multiple secrets. For more information, see JSON structure of Secrets Manager secrets .

You can specify MasterSecretArn or SuperuserSecretArn but not both. They represent the same superuser secret.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-superusersecretarn

superuser_secret_kms_key_arn

The ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don’t need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You can specify MasterSecretKmsKeyArn or SuperuserSecretKmsKeyArn but not both. They represent the same superuser secret KMS key .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-superusersecretkmskeyarn

vpc_security_group_ids

A comma-separated list of security group IDs applied to the target database.

The template applies the same security groups as on the Lambda rotation function that is created as part of this stack.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-vpcsecuritygroupids

vpc_subnet_ids

A comma separated list of VPC subnet IDs of the target database network.

The Lambda rotation function is in the same subnet group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-hostedrotationlambda.html#cfn-secretsmanager-rotationschedule-hostedrotationlambda-vpcsubnetids

RotationRulesProperty

class CfnRotationSchedulePropsMixin.RotationRulesProperty(*, automatically_after_days=None, duration=None, schedule_expression=None)

Bases: object

The rotation schedule and window.

We recommend you use ScheduleExpression to set a cron or rate expression for the schedule and Duration to set the length of the rotation window. .. epigraph:

When changing an existing rotation schedule and setting ``RotateImmediatelyOnUpdate`` to ``false`` :

- If using ``AutomaticallyAfterDays`` or a ``ScheduleExpression`` with ``rate()`` , the previously scheduled rotation might still occur.
- To prevent unintended rotations, use a ``ScheduleExpression`` with ``cron()`` for granular control over rotation windows.
Parameters:
  • automatically_after_days (Union[int, float, None]) – The number of days between automatic scheduled rotations of the secret. You can use this value to check that your secret meets your compliance guidelines for how often secrets must be rotated. In DescribeSecret and ListSecrets , this value is calculated from the rotation schedule after every successful rotation. In RotateSecret , you can set the rotation schedule in RotationRules with AutomaticallyAfterDays or ScheduleExpression , but not both.

  • duration (Optional[str]) – The length of the rotation window in hours, for example 3h for a three hour window. Secrets Manager rotates your secret at any time during this window. The window must not extend into the next rotation window or the next UTC day. The window starts according to the ScheduleExpression . If you don’t specify a Duration , for a ScheduleExpression in hours, the window automatically closes after one hour. For a ScheduleExpression in days, the window automatically closes at the end of the UTC day. For more information, including examples, see Schedule expressions in Secrets Manager rotation in the Secrets Manager Users Guide .

  • schedule_expression (Optional[str]) –

    A cron() or rate() expression that defines the schedule for rotating your secret. Secrets Manager rotation schedules use UTC time zone. Secrets Manager rotates your secret any time during a rotation window. Secrets Manager rate() expressions represent the interval in hours or days that you want to rotate your secret, for example rate(12 hours) or rate(10 days) . You can rotate a secret as often as every four hours. If you use a rate() expression, the rotation window starts at midnight. For a rate in hours, the default rotation window closes after one hour. For a rate in days, the default rotation window closes at the end of the day. You can set the Duration to change the rotation window. The rotation window must not extend into the next UTC day or into the next rotation window. You can use a cron() expression to create a rotation schedule that is more detailed than a rotation interval. For more information, including examples, see Schedule expressions in Secrets Manager rotation in the Secrets Manager Users Guide . For a cron expression that represents a schedule in hours, the default rotation window closes after one hour. For a cron expression that represents a schedule in days, the default rotation window closes at the end of the day. You can set the Duration to change the rotation window. The rotation window must not extend into the next UTC day or into the next rotation window.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_secretsmanager import mixins as secretsmanager_mixins

rotation_rules_property = secretsmanager_mixins.CfnRotationSchedulePropsMixin.RotationRulesProperty(
    automatically_after_days=123,
    duration="duration",
    schedule_expression="scheduleExpression"
)

Attributes

automatically_after_days

The number of days between automatic scheduled rotations of the secret.

You can use this value to check that your secret meets your compliance guidelines for how often secrets must be rotated.

In DescribeSecret and ListSecrets , this value is calculated from the rotation schedule after every successful rotation. In RotateSecret , you can set the rotation schedule in RotationRules with AutomaticallyAfterDays or ScheduleExpression , but not both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html#cfn-secretsmanager-rotationschedule-rotationrules-automaticallyafterdays

duration

The length of the rotation window in hours, for example 3h for a three hour window.

Secrets Manager rotates your secret at any time during this window. The window must not extend into the next rotation window or the next UTC day. The window starts according to the ScheduleExpression . If you don’t specify a Duration , for a ScheduleExpression in hours, the window automatically closes after one hour. For a ScheduleExpression in days, the window automatically closes at the end of the UTC day. For more information, including examples, see Schedule expressions in Secrets Manager rotation in the Secrets Manager Users Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html#cfn-secretsmanager-rotationschedule-rotationrules-duration

schedule_expression

A cron() or rate() expression that defines the schedule for rotating your secret.

Secrets Manager rotation schedules use UTC time zone. Secrets Manager rotates your secret any time during a rotation window.

Secrets Manager rate() expressions represent the interval in hours or days that you want to rotate your secret, for example rate(12 hours) or rate(10 days) . You can rotate a secret as often as every four hours. If you use a rate() expression, the rotation window starts at midnight. For a rate in hours, the default rotation window closes after one hour. For a rate in days, the default rotation window closes at the end of the day. You can set the Duration to change the rotation window. The rotation window must not extend into the next UTC day or into the next rotation window.

You can use a cron() expression to create a rotation schedule that is more detailed than a rotation interval. For more information, including examples, see Schedule expressions in Secrets Manager rotation in the Secrets Manager Users Guide . For a cron expression that represents a schedule in hours, the default rotation window closes after one hour. For a cron expression that represents a schedule in days, the default rotation window closes at the end of the day. You can set the Duration to change the rotation window. The rotation window must not extend into the next UTC day or into the next rotation window.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html#cfn-secretsmanager-rotationschedule-rotationrules-scheduleexpression