Class CfnDatabaseProps.Builder

java.lang.Object
software.amazon.awscdk.services.lightsail.CfnDatabaseProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnDatabaseProps>
Enclosing interface:
CfnDatabaseProps

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

    • Builder

      public Builder()
  • Method Details

    • masterDatabaseName

      @Stability(Stable) public CfnDatabaseProps.Builder masterDatabaseName(String masterDatabaseName)
      Parameters:
      masterDatabaseName - The meaning of this parameter differs according to the database engine you use. This parameter is required. MySQL

      The name of the database to create when the Lightsail database resource is created. If this parameter isn't specified, no database is created in the database resource.

      Constraints:

      • Must contain 1-64 letters or numbers.
      • Must begin with a letter. Subsequent characters can be letters, underscores, or numbers (0-9).
      • Can't be a word reserved by the specified database engine.

      For more information about reserved words in MySQL, see the Keywords and Reserved Words articles for MySQL 5.6 , MySQL 5.7 , and MySQL 8.0 .

      PostgreSQL

      The name of the database to create when the Lightsail database resource is created. If this parameter isn't specified, a database named postgres is created in the database resource.

      Constraints:

      • Must contain 1-63 letters or numbers.
      • Must begin with a letter. Subsequent characters can be letters, underscores, or numbers (0-9).
      • Can't be a word reserved by the specified database engine.

      For more information about reserved words in PostgreSQL, see the SQL Key Words articles for PostgreSQL 9.6 , PostgreSQL 10 , PostgreSQL 11 , and PostgreSQL 12 .

      Returns:
      this
    • masterUsername

      @Stability(Stable) public CfnDatabaseProps.Builder masterUsername(String masterUsername)
      Parameters:
      masterUsername - The name for the primary user. This parameter is required. MySQL

      Constraints:

      • Required for MySQL.
      • Must be 1-16 letters or numbers. Can contain underscores.
      • First character must be a letter.
      • Can't be a reserved word for the chosen database engine.

      For more information about reserved words in MySQL 5.6 or 5.7, see the Keywords and Reserved Words articles for MySQL 5.6 , MySQL 5.7 , or MySQL 8.0 .

      PostgreSQL

      Constraints:

      • Required for PostgreSQL.
      • Must be 1-63 letters or numbers. Can contain underscores.
      • First character must be a letter.
      • Can't be a reserved word for the chosen database engine.

      For more information about reserved words in MySQL 5.6 or 5.7, see the Keywords and Reserved Words articles for PostgreSQL 9.6 , PostgreSQL 10 , PostgreSQL 11 , and PostgreSQL 12 .

      Returns:
      this
    • relationalDatabaseBlueprintId

      @Stability(Stable) public CfnDatabaseProps.Builder relationalDatabaseBlueprintId(String relationalDatabaseBlueprintId)
      Parameters:
      relationalDatabaseBlueprintId - The blueprint ID for the database (for example, mysql_8_0 ). This parameter is required.
      Returns:
      this
    • relationalDatabaseBundleId

      @Stability(Stable) public CfnDatabaseProps.Builder relationalDatabaseBundleId(String relationalDatabaseBundleId)
      Parameters:
      relationalDatabaseBundleId - The bundle ID for the database (for example, medium_1_0 ). This parameter is required.
      Returns:
      this
    • relationalDatabaseName

      @Stability(Stable) public CfnDatabaseProps.Builder relationalDatabaseName(String relationalDatabaseName)
      Parameters:
      relationalDatabaseName - The name of the instance. This parameter is required.
      Returns:
      this
    • availabilityZone

      @Stability(Stable) public CfnDatabaseProps.Builder availabilityZone(String availabilityZone)
      Parameters:
      availabilityZone - The Availability Zone for the database.
      Returns:
      this
    • backupRetention

      @Stability(Stable) public CfnDatabaseProps.Builder backupRetention(Boolean backupRetention)
      Parameters:
      backupRetention - A Boolean value indicating whether automated backup retention is enabled for the database.
      Returns:
      this
    • backupRetention

      @Stability(Stable) public CfnDatabaseProps.Builder backupRetention(IResolvable backupRetention)
      Parameters:
      backupRetention - A Boolean value indicating whether automated backup retention is enabled for the database.
      Returns:
      this
    • caCertificateIdentifier

      @Stability(Stable) public CfnDatabaseProps.Builder caCertificateIdentifier(String caCertificateIdentifier)
      Parameters:
      caCertificateIdentifier - The certificate associated with the database.
      Returns:
      this
    • masterUserPassword

      @Stability(Stable) public CfnDatabaseProps.Builder masterUserPassword(String masterUserPassword)
      Parameters:
      masterUserPassword - The password for the primary user of the database. The password can include any printable ASCII character except the following: /, ", or @. It cannot contain spaces.

      The MasterUserPassword and RotateMasterUserPassword parameters cannot be used together in the same template.

      MySQL

      Constraints: Must contain 8-41 characters.

      PostgreSQL

      Constraints: Must contain 8-128 characters.

      Returns:
      this
    • preferredBackupWindow

      @Stability(Stable) public CfnDatabaseProps.Builder preferredBackupWindow(String preferredBackupWindow)
      Parameters:
      preferredBackupWindow - The daily time range during which automated backups are created for the database (for example, 16:00-16:30 ).
      Returns:
      this
    • preferredMaintenanceWindow

      @Stability(Stable) public CfnDatabaseProps.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow)
      Parameters:
      preferredMaintenanceWindow - The weekly time range during which system maintenance can occur for the database, formatted as follows: ddd:hh24:mi-ddd:hh24:mi . For example, Tue:17:00-Tue:17:30 .
      Returns:
      this
    • publiclyAccessible

      @Stability(Stable) public CfnDatabaseProps.Builder publiclyAccessible(Boolean publiclyAccessible)
      Parameters:
      publiclyAccessible - A Boolean value indicating whether the database is accessible to anyone on the internet.
      Returns:
      this
    • publiclyAccessible

      @Stability(Stable) public CfnDatabaseProps.Builder publiclyAccessible(IResolvable publiclyAccessible)
      Parameters:
      publiclyAccessible - A Boolean value indicating whether the database is accessible to anyone on the internet.
      Returns:
      this
    • relationalDatabaseParameters

      @Stability(Stable) public CfnDatabaseProps.Builder relationalDatabaseParameters(IResolvable relationalDatabaseParameters)
      Parameters:
      relationalDatabaseParameters - An array of parameters for the database.
      Returns:
      this
    • relationalDatabaseParameters

      @Stability(Stable) public CfnDatabaseProps.Builder relationalDatabaseParameters(List<? extends Object> relationalDatabaseParameters)
      Parameters:
      relationalDatabaseParameters - An array of parameters for the database.
      Returns:
      this
    • rotateMasterUserPassword

      @Stability(Stable) public CfnDatabaseProps.Builder rotateMasterUserPassword(Boolean rotateMasterUserPassword)
      Parameters:
      rotateMasterUserPassword - A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .

      The RotateMasterUserPassword and MasterUserPassword parameters cannot be used together in the same template.

      Returns:
      this
    • rotateMasterUserPassword

      @Stability(Stable) public CfnDatabaseProps.Builder rotateMasterUserPassword(IResolvable rotateMasterUserPassword)
      Parameters:
      rotateMasterUserPassword - A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .

      The RotateMasterUserPassword and MasterUserPassword parameters cannot be used together in the same template.

      Returns:
      this
    • tags

      @Stability(Stable) public CfnDatabaseProps.Builder tags(List<? extends CfnTag> tags)
      Sets the value of CfnDatabaseProps.getTags()
      Parameters:
      tags - An array of key-value pairs to apply to this resource. For more information, see Tag in the AWS CloudFormation User Guide .

      The Value of Tags is optional for Lightsail resources.

      Returns:
      this
    • build

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