Class CfnDatabaseProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnDatabaseProps>
- Enclosing interface:
CfnDatabaseProps
CfnDatabaseProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionavailabilityZone
(String availabilityZone) Sets the value ofCfnDatabaseProps.getAvailabilityZone()
backupRetention
(Boolean backupRetention) Sets the value ofCfnDatabaseProps.getBackupRetention()
backupRetention
(IResolvable backupRetention) Sets the value ofCfnDatabaseProps.getBackupRetention()
build()
Builds the configured instance.caCertificateIdentifier
(String caCertificateIdentifier) Sets the value ofCfnDatabaseProps.getCaCertificateIdentifier()
masterDatabaseName
(String masterDatabaseName) Sets the value ofCfnDatabaseProps.getMasterDatabaseName()
masterUsername
(String masterUsername) Sets the value ofCfnDatabaseProps.getMasterUsername()
masterUserPassword
(String masterUserPassword) Sets the value ofCfnDatabaseProps.getMasterUserPassword()
preferredBackupWindow
(String preferredBackupWindow) Sets the value ofCfnDatabaseProps.getPreferredBackupWindow()
preferredMaintenanceWindow
(String preferredMaintenanceWindow) Sets the value ofCfnDatabaseProps.getPreferredMaintenanceWindow()
publiclyAccessible
(Boolean publiclyAccessible) Sets the value ofCfnDatabaseProps.getPubliclyAccessible()
publiclyAccessible
(IResolvable publiclyAccessible) Sets the value ofCfnDatabaseProps.getPubliclyAccessible()
relationalDatabaseBlueprintId
(String relationalDatabaseBlueprintId) Sets the value ofCfnDatabaseProps.getRelationalDatabaseBlueprintId()
relationalDatabaseBundleId
(String relationalDatabaseBundleId) Sets the value ofCfnDatabaseProps.getRelationalDatabaseBundleId()
relationalDatabaseName
(String relationalDatabaseName) Sets the value ofCfnDatabaseProps.getRelationalDatabaseName()
relationalDatabaseParameters
(List<? extends Object> relationalDatabaseParameters) Sets the value ofCfnDatabaseProps.getRelationalDatabaseParameters()
relationalDatabaseParameters
(IResolvable relationalDatabaseParameters) Sets the value ofCfnDatabaseProps.getRelationalDatabaseParameters()
rotateMasterUserPassword
(Boolean rotateMasterUserPassword) Sets the value ofCfnDatabaseProps.getRotateMasterUserPassword()
rotateMasterUserPassword
(IResolvable rotateMasterUserPassword) Sets the value ofCfnDatabaseProps.getRotateMasterUserPassword()
Sets the value ofCfnDatabaseProps.getTags()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
masterDatabaseName
Sets the value ofCfnDatabaseProps.getMasterDatabaseName()
- Parameters:
masterDatabaseName
- The meaning of this parameter differs according to the database engine you use. This parameter is required. MySQLThe 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
Sets the value ofCfnDatabaseProps.getMasterUsername()
- Parameters:
masterUsername
- The name for the primary user. This parameter is required. MySQLConstraints:
- 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) Sets the value ofCfnDatabaseProps.getRelationalDatabaseBlueprintId()
- 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) Sets the value ofCfnDatabaseProps.getRelationalDatabaseBundleId()
- 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) Sets the value ofCfnDatabaseProps.getRelationalDatabaseName()
- Parameters:
relationalDatabaseName
- The name of the instance. This parameter is required.- Returns:
this
-
availabilityZone
Sets the value ofCfnDatabaseProps.getAvailabilityZone()
- Parameters:
availabilityZone
- The Availability Zone for the database.- Returns:
this
-
backupRetention
Sets the value ofCfnDatabaseProps.getBackupRetention()
- Parameters:
backupRetention
- A Boolean value indicating whether automated backup retention is enabled for the database. Data Import Mode is enabled whenBackupRetention
is set tofalse
, and is disabled whenBackupRetention
is set totrue
.- Returns:
this
-
backupRetention
Sets the value ofCfnDatabaseProps.getBackupRetention()
- Parameters:
backupRetention
- A Boolean value indicating whether automated backup retention is enabled for the database. Data Import Mode is enabled whenBackupRetention
is set tofalse
, and is disabled whenBackupRetention
is set totrue
.- Returns:
this
-
caCertificateIdentifier
@Stability(Stable) public CfnDatabaseProps.Builder caCertificateIdentifier(String caCertificateIdentifier) Sets the value ofCfnDatabaseProps.getCaCertificateIdentifier()
- Parameters:
caCertificateIdentifier
- The certificate associated with the database.- Returns:
this
-
masterUserPassword
Sets the value ofCfnDatabaseProps.getMasterUserPassword()
- Parameters:
masterUserPassword
- The password for the primary user of the database. The password can include any printable ASCII character except the following: /, ", or- Returns:
this
-
preferredBackupWindow
@Stability(Stable) public CfnDatabaseProps.Builder preferredBackupWindow(String preferredBackupWindow) Sets the value ofCfnDatabaseProps.getPreferredBackupWindow()
- 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) Sets the value ofCfnDatabaseProps.getPreferredMaintenanceWindow()
- 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
Sets the value ofCfnDatabaseProps.getPubliclyAccessible()
- 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) Sets the value ofCfnDatabaseProps.getPubliclyAccessible()
- 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) Sets the value ofCfnDatabaseProps.getRelationalDatabaseParameters()
- Parameters:
relationalDatabaseParameters
- An array of parameters for the database.- Returns:
this
-
relationalDatabaseParameters
@Stability(Stable) public CfnDatabaseProps.Builder relationalDatabaseParameters(List<? extends Object> relationalDatabaseParameters) Sets the value ofCfnDatabaseProps.getRelationalDatabaseParameters()
- Parameters:
relationalDatabaseParameters
- An array of parameters for the database.- Returns:
this
-
rotateMasterUserPassword
@Stability(Stable) public CfnDatabaseProps.Builder rotateMasterUserPassword(Boolean rotateMasterUserPassword) Sets the value ofCfnDatabaseProps.getRotateMasterUserPassword()
- Parameters:
rotateMasterUserPassword
- A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .The
RotateMasterUserPassword
andMasterUserPassword
parameters cannot be used together in the same template.- Returns:
this
-
rotateMasterUserPassword
@Stability(Stable) public CfnDatabaseProps.Builder rotateMasterUserPassword(IResolvable rotateMasterUserPassword) Sets the value ofCfnDatabaseProps.getRotateMasterUserPassword()
- Parameters:
rotateMasterUserPassword
- A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .The
RotateMasterUserPassword
andMasterUserPassword
parameters cannot be used together in the same template.- Returns:
this
-
tags
Sets the value ofCfnDatabaseProps.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
ofTags
is optional for Lightsail resources.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnDatabaseProps>
- Returns:
- a new instance of
CfnDatabaseProps
- Throws:
NullPointerException
- if any required attribute was not provided
-