Class SecretRotation.Builder

java.lang.Object
software.amazon.awscdk.services.secretsmanager.SecretRotation.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<SecretRotation>
Enclosing class:
SecretRotation

@Stability(Stable) public static final class SecretRotation.Builder extends Object implements software.amazon.jsii.Builder<SecretRotation>
A fluent builder for SecretRotation.
  • Method Details

    • create

      @Stability(Stable) public static SecretRotation.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of SecretRotation.Builder.
    • application

      @Stability(Stable) public SecretRotation.Builder application(SecretRotationApplication application)
      The serverless application for the rotation.

      Parameters:
      application - The serverless application for the rotation. This parameter is required.
      Returns:
      this
    • secret

      @Stability(Stable) public SecretRotation.Builder secret(ISecret secret)
      The secret to rotate. It 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.

      Parameters:
      secret - The secret to rotate. It must be a JSON string with the following format:. This parameter is required.
      Returns:
      this
      See Also:
    • target

      @Stability(Stable) public SecretRotation.Builder target(IConnectable target)
      The target service or database.

      Parameters:
      target - The target service or database. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Stable) public SecretRotation.Builder vpc(IVpc vpc)
      The VPC where the Lambda rotation function will run.

      Parameters:
      vpc - The VPC where the Lambda rotation function will run. This parameter is required.
      Returns:
      this
    • automaticallyAfter

      @Stability(Stable) public SecretRotation.Builder automaticallyAfter(Duration automaticallyAfter)
      Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

      Default: Duration.days(30)

      Parameters:
      automaticallyAfter - Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation. This parameter is required.
      Returns:
      this
    • endpoint

      @Stability(Stable) public SecretRotation.Builder endpoint(IInterfaceVpcEndpoint endpoint)
      The VPC interface endpoint to use for the Secrets Manager API.

      If you enable private DNS hostnames for your VPC private endpoint (the default), you don't need to specify an endpoint. The standard Secrets Manager DNS hostname the Secrets Manager CLI and SDKs use by default (https://secretsmanager..amazonaws.com) automatically resolves to your VPC endpoint.

      Default: https://secretsmanager..amazonaws.com

      Parameters:
      endpoint - The VPC interface endpoint to use for the Secrets Manager API. This parameter is required.
      Returns:
      this
    • excludeCharacters

      @Stability(Stable) public SecretRotation.Builder excludeCharacters(String excludeCharacters)
      Characters which should not appear in the generated password.

      Default: - no additional characters are explicitly excluded

      Parameters:
      excludeCharacters - Characters which should not appear in the generated password. This parameter is required.
      Returns:
      this
    • masterSecret

      @Stability(Stable) public SecretRotation.Builder masterSecret(ISecret masterSecret)
      The master secret for a multi user rotation scheme.

      Default: - single user rotation scheme

      Parameters:
      masterSecret - The master secret for a multi user rotation scheme. This parameter is required.
      Returns:
      this
    • securityGroup

      @Stability(Stable) public SecretRotation.Builder securityGroup(ISecurityGroup securityGroup)
      The security group for the Lambda rotation function.

      Default: - a new security group is created

      Parameters:
      securityGroup - The security group for the Lambda rotation function. This parameter is required.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public SecretRotation.Builder vpcSubnets(SubnetSelection vpcSubnets)
      The type of subnets in the VPC where the Lambda rotation function will run.

      Default: - the Vpc default strategy if not specified.

      Parameters:
      vpcSubnets - The type of subnets in the VPC where the Lambda rotation function will run. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public SecretRotation build()
      Specified by:
      build in interface software.amazon.jsii.Builder<SecretRotation>
      Returns:
      a newly built instance of SecretRotation.