Table of Contents

Class RotationScheduleProps

Namespace
Amazon.CDK.AWS.SecretsManager
Assembly
Amazon.CDK.AWS.SecretsManager.dll

Construction properties for a RotationSchedule.

public class RotationScheduleProps : IRotationScheduleProps, IRotationScheduleOptions
Inheritance
RotationScheduleProps
Implements
Inherited Members

Examples

// The code below shows an example of how to instantiate this type.
            // The values are placeholders you should change.
            using Amazon.CDK.AWS.Lambda;
            using Amazon.CDK.AWS.SecretsManager;
            using Amazon.CDK;

            Function function_;
            HostedRotation hostedRotation;
            Secret secret;
            var rotationScheduleProps = new RotationScheduleProps {
                Secret = secret,

                // the properties below are optional
                AutomaticallyAfter = Duration.Minutes(30),
                HostedRotation = hostedRotation,
                RotationLambda = function_
            };

Remarks

ExampleMetadata: fixture=_generated

Constructors

RotationScheduleProps()

public RotationScheduleProps()

Properties

AutomaticallyAfter

Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

public Duration? AutomaticallyAfter { get; set; }

Property Value

Duration

Remarks

A value of zero will disable automatic rotation - Duration.days(0).

Default: Duration.days(30)

HostedRotation

Hosted rotation.

public HostedRotation? HostedRotation { get; set; }

Property Value

HostedRotation

Remarks

Default: - either rotationLambda or hostedRotation must be specified

RotationLambda

A Lambda function that can rotate the secret.

public IFunction? RotationLambda { get; set; }

Property Value

IFunction

Remarks

Default: - either rotationLambda or hostedRotation must be specified

Secret

The secret to rotate.

public ISecret Secret { get; set; }

Property Value

ISecret

Remarks

If hosted rotation is used, this must be a JSON string with the following format:

{
   "engine": <required: database engine>,
   "host": <required: instance host name>,
   "username": <required: username>,
   "password": <required: password>,
   "dbname": <optional: database name>,
   "port": <optional: if not specified, default port will be used>,
   "masterarn": <required for multi user rotation: the arn of the master secret which will be used to create users/change passwords>
}

This is typically the case for a secret referenced from an AWS::SecretsManager::SecretTargetAttachment or an ISecret returned by the attach() method of Secret.