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 Details

    • Builder

      public Builder()
  • Method Details

    • secret

      @Stability(Stable) public RotationScheduleProps.Builder secret(ISecret secret)
      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::SecretTargetAttachment or an ISecret returned by the attach() method of Secret.

      Returns:
      this
    • automaticallyAfter

      @Stability(Stable) public RotationScheduleProps.Builder automaticallyAfter(Duration automaticallyAfter)
      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)
      Parameters:
      hostedRotation - Hosted rotation.
      Returns:
      this
    • rotationLambda

      @Stability(Stable) public RotationScheduleProps.Builder rotationLambda(IFunction rotationLambda)
      Parameters:
      rotationLambda - A Lambda function that can rotate the secret.
      Returns:
      this
    • build

      @Stability(Stable) public RotationScheduleProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<RotationScheduleProps>
      Returns:
      a new instance of RotationScheduleProps
      Throws:
      NullPointerException - if any required attribute was not provided