Class DatabaseSecret.Builder

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

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

    • create

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

      @Stability(Stable) public DatabaseSecret.Builder username(String username)
      The username.

      Parameters:
      username - The username. This parameter is required.
      Returns:
      this
    • dbname

      @Stability(Stable) public DatabaseSecret.Builder dbname(String dbname)
      The database name, if not using the default one.

      Default: - whatever the secret generates after the attach method is run

      Parameters:
      dbname - The database name, if not using the default one. This parameter is required.
      Returns:
      this
    • encryptionKey

      @Stability(Stable) public DatabaseSecret.Builder encryptionKey(IKey encryptionKey)
      The KMS key to use to encrypt the secret.

      Default: default master key

      Parameters:
      encryptionKey - The KMS key to use to encrypt the secret. This parameter is required.
      Returns:
      this
    • excludeCharacters

      @Stability(Stable) public DatabaseSecret.Builder excludeCharacters(String excludeCharacters)
      Characters to not include in the generated password.

      Default: " %+~`#$invalid input: '&'*()|[]{}:;invalid input: '<'>?!'/@\"\\"

      Parameters:
      excludeCharacters - Characters to not include in the generated password. This parameter is required.
      Returns:
      this
    • masterSecret

      @Stability(Stable) public DatabaseSecret.Builder masterSecret(ISecret masterSecret)
      The master secret which will be used to rotate this secret.

      Default: - no master secret information will be included

      Parameters:
      masterSecret - The master secret which will be used to rotate this secret. This parameter is required.
      Returns:
      this
    • replaceOnPasswordCriteriaChanges

      @Stability(Stable) public DatabaseSecret.Builder replaceOnPasswordCriteriaChanges(Boolean replaceOnPasswordCriteriaChanges)
      Whether to replace this secret when the criteria for the password change.

      This is achieved by overriding the logical id of the AWS::SecretsManager::Secret with a hash of the options that influence the password generation. This way a new secret will be created when the password is regenerated and the cluster or instance consuming this secret will have its credentials updated.

      Default: false

      Parameters:
      replaceOnPasswordCriteriaChanges - Whether to replace this secret when the criteria for the password change. This parameter is required.
      Returns:
      this
    • replicaRegions

      @Stability(Stable) public DatabaseSecret.Builder replicaRegions(List<? extends ReplicaRegion> replicaRegions)
      A list of regions where to replicate this secret.

      Default: - Secret is not replicated

      Parameters:
      replicaRegions - A list of regions where to replicate this secret. This parameter is required.
      Returns:
      this
    • secretName

      @Stability(Stable) public DatabaseSecret.Builder secretName(String secretName)
      A name for the secret.

      Default: - A name is generated by CloudFormation.

      Parameters:
      secretName - A name for the secret. This parameter is required.
      Returns:
      this
    • build

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