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()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. A value of zero will disable automatic rotation -Duration.days(0).- Returns:
this
-
hostedRotation
@Stability(Stable) public RotationScheduleProps.Builder hostedRotation(HostedRotation hostedRotation) Sets the value ofRotationScheduleOptions.getHostedRotation()- Parameters:
hostedRotation- Hosted rotation.- 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
-