Class RotationScheduleProps.Builder
java.lang.Object
software.amazon.awscdk.services.secretsmanager.RotationScheduleProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<RotationScheduleProps>
- Enclosing interface:
RotationScheduleProps
@Stability(Stable)
public static final class RotationScheduleProps.Builder
extends Object
implements software.amazon.jsii.Builder<RotationScheduleProps>
A builder for
RotationScheduleProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautomaticallyAfter(Duration automaticallyAfter) Sets the value ofRotationScheduleOptions.getAutomaticallyAfter()build()Builds the configured instance.hostedRotation(HostedRotation hostedRotation) Sets the value ofRotationScheduleOptions.getHostedRotation()rotateImmediatelyOnUpdate(Boolean rotateImmediatelyOnUpdate) Sets the value ofRotationScheduleOptions.getRotateImmediatelyOnUpdate()rotationLambda(IFunction rotationLambda) Sets the value ofRotationScheduleOptions.getRotationLambda()Sets the value ofRotationScheduleProps.getSecret()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
secret
Sets the value ofRotationScheduleProps.getSecret()- Parameters:
secret- The secret to rotate. This parameter is required. 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::SecretTargetAttachmentor anISecretreturned by theattach()method ofSecret.- Returns:
this
-
automaticallyAfter
@Stability(Stable) public RotationScheduleProps.Builder automaticallyAfter(Duration automaticallyAfter) Sets the value ofRotationScheduleOptions.getAutomaticallyAfter()- Parameters:
automaticallyAfter- Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation. The minimum value is 4 hours. The maximum value is 1000 days.A value of zero (
Duration.days(0)) will not create RotationRules.- Returns:
this
-
hostedRotation
@Stability(Stable) public RotationScheduleProps.Builder hostedRotation(HostedRotation hostedRotation) Sets the value ofRotationScheduleOptions.getHostedRotation()- Parameters:
hostedRotation- Hosted rotation.- Returns:
this
-
rotateImmediatelyOnUpdate
@Stability(Stable) public RotationScheduleProps.Builder rotateImmediatelyOnUpdate(Boolean rotateImmediatelyOnUpdate) Sets the value ofRotationScheduleOptions.getRotateImmediatelyOnUpdate()- Parameters:
rotateImmediatelyOnUpdate- Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.- Returns:
this
-
rotationLambda
Sets the value ofRotationScheduleOptions.getRotationLambda()- Parameters:
rotationLambda- A Lambda function that can rotate the secret.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<RotationScheduleProps>- Returns:
- a new instance of
RotationScheduleProps - Throws:
NullPointerException- if any required attribute was not provided
-