Class RotationScheduleProps
Construction properties for a RotationSchedule.
Inheritance
Namespace: Amazon.CDK.AWS.SecretsManager
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class RotationScheduleProps : Object, IRotationScheduleProps, IRotationScheduleOptions
Syntax (vb)
Public Class RotationScheduleProps
Inherits Object
Implements IRotationScheduleProps, IRotationScheduleOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK.AWS.SecretsManager;
Function function_;
HostedRotation hostedRotation;
Secret secret;
var rotationScheduleProps = new RotationScheduleProps {
Secret = secret,
// the properties below are optional
AutomaticallyAfter = Duration.Minutes(30),
HostedRotation = hostedRotation,
RotateImmediatelyOnUpdate = false,
RotationLambda = function_
};
Synopsis
Constructors
RotationScheduleProps() |
Properties
AutomaticallyAfter | Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation. |
HostedRotation | Hosted rotation. |
RotateImmediatelyOnUpdate | Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window. |
RotationLambda | A Lambda function that can rotate the secret. |
Secret | The secret to rotate. |
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
Remarks
The minimum value is 4 hours. The maximum value is 1000 days.
A value of zero (Duration.days(0)
) will not create RotationRules.
Default: Duration.days(30)
HostedRotation
Hosted rotation.
public HostedRotation HostedRotation { get; set; }
Property Value
Remarks
Default: - either rotationLambda
or hostedRotation
must be specified
RotateImmediatelyOnUpdate
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
public Nullable<bool> RotateImmediatelyOnUpdate { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
RotationLambda
A Lambda function that can rotate the secret.
public IFunction RotationLambda { get; set; }
Property Value
Remarks
Default: - either rotationLambda
or hostedRotation
must be specified
Secret
The secret to rotate.
public ISecret Secret { get; set; }
Property Value
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
.