@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-28T21:34:17.518Z") public class CfnDatabase extends CfnResource implements IInspectable
The AWS::Lightsail::Database
resource specifies an Amazon Lightsail database.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.lightsail.*; CfnDatabase cfnDatabase = CfnDatabase.Builder.create(this, "MyCfnDatabase") .masterDatabaseName("masterDatabaseName") .masterUsername("masterUsername") .relationalDatabaseBlueprintId("relationalDatabaseBlueprintId") .relationalDatabaseBundleId("relationalDatabaseBundleId") .relationalDatabaseName("relationalDatabaseName") // the properties below are optional .availabilityZone("availabilityZone") .backupRetention(false) .caCertificateIdentifier("caCertificateIdentifier") .masterUserPassword("masterUserPassword") .preferredBackupWindow("preferredBackupWindow") .preferredMaintenanceWindow("preferredMaintenanceWindow") .publiclyAccessible(false) .relationalDatabaseParameters(List.of(RelationalDatabaseParameterProperty.builder() .allowedValues("allowedValues") .applyMethod("applyMethod") .applyType("applyType") .dataType("dataType") .description("description") .isModifiable(false) .parameterName("parameterName") .parameterValue("parameterValue") .build())) .rotateMasterUserPassword(false) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnDatabase.Builder
A fluent builder for
CfnDatabase . |
static interface |
CfnDatabase.RelationalDatabaseParameterProperty
`RelationalDatabaseParameter` is a property of the [AWS::Lightsail::Database](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html) resource.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnDatabase(Construct scope,
java.lang.String id,
CfnDatabaseProps props)
Create a new `AWS::Lightsail::Database`.
|
protected |
CfnDatabase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnDatabase(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrDatabaseArn()
The Amazon Resource Name (ARN) of the database (for example, `arn:aws:lightsail:us-east-2:123456789101:RelationalDatabase/244ad76f-8aad-4741-809f-12345EXAMPLE` ).
|
java.lang.String |
getAvailabilityZone()
The Availability Zone for the database.
|
java.lang.Object |
getBackupRetention()
A Boolean value indicating whether automated backup retention is enabled for the database.
|
java.lang.String |
getCaCertificateIdentifier()
The certificate associated with the database.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getMasterDatabaseName()
The meaning of this parameter differs according to the database engine you use.
|
java.lang.String |
getMasterUsername()
The name for the primary user.
|
java.lang.String |
getMasterUserPassword()
The password for the primary user of the database.
|
java.lang.String |
getPreferredBackupWindow()
The daily time range during which automated backups are created for the database (for example, `16:00-16:30` ).
|
java.lang.String |
getPreferredMaintenanceWindow()
The weekly time range during which system maintenance can occur for the database, formatted as follows: `ddd:hh24:mi-ddd:hh24:mi` .
|
java.lang.Object |
getPubliclyAccessible()
A Boolean value indicating whether the database is accessible to anyone on the internet.
|
java.lang.String |
getRelationalDatabaseBlueprintId()
The blueprint ID for the database (for example, `mysql_8_0` ).
|
java.lang.String |
getRelationalDatabaseBundleId()
The bundle ID for the database (for example, `medium_1_0` ).
|
java.lang.String |
getRelationalDatabaseName()
The name of the instance.
|
java.lang.Object |
getRelationalDatabaseParameters()
An array of parameters for the database.
|
java.lang.Object |
getRotateMasterUserPassword()
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
|
TagManager |
getTags()
An array of key-value pairs to apply to this resource.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setAvailabilityZone(java.lang.String value)
The Availability Zone for the database.
|
void |
setBackupRetention(java.lang.Boolean value)
A Boolean value indicating whether automated backup retention is enabled for the database.
|
void |
setBackupRetention(IResolvable value)
A Boolean value indicating whether automated backup retention is enabled for the database.
|
void |
setCaCertificateIdentifier(java.lang.String value)
The certificate associated with the database.
|
void |
setMasterDatabaseName(java.lang.String value)
The meaning of this parameter differs according to the database engine you use.
|
void |
setMasterUsername(java.lang.String value)
The name for the primary user.
|
void |
setMasterUserPassword(java.lang.String value)
The password for the primary user of the database.
|
void |
setPreferredBackupWindow(java.lang.String value)
The daily time range during which automated backups are created for the database (for example, `16:00-16:30` ).
|
void |
setPreferredMaintenanceWindow(java.lang.String value)
The weekly time range during which system maintenance can occur for the database, formatted as follows: `ddd:hh24:mi-ddd:hh24:mi` .
|
void |
setPubliclyAccessible(java.lang.Boolean value)
A Boolean value indicating whether the database is accessible to anyone on the internet.
|
void |
setPubliclyAccessible(IResolvable value)
A Boolean value indicating whether the database is accessible to anyone on the internet.
|
void |
setRelationalDatabaseBlueprintId(java.lang.String value)
The blueprint ID for the database (for example, `mysql_8_0` ).
|
void |
setRelationalDatabaseBundleId(java.lang.String value)
The bundle ID for the database (for example, `medium_1_0` ).
|
void |
setRelationalDatabaseName(java.lang.String value)
The name of the instance.
|
void |
setRelationalDatabaseParameters(IResolvable value)
An array of parameters for the database.
|
void |
setRelationalDatabaseParameters(java.util.List<java.lang.Object> value)
An array of parameters for the database.
|
void |
setRotateMasterUserPassword(java.lang.Boolean value)
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
|
void |
setRotateMasterUserPassword(IResolvable value)
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnDatabase(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnDatabase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnDatabase(Construct scope, java.lang.String id, CfnDatabaseProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrDatabaseArn()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
For more information, see Tag in the AWS CloudFormation User Guide .
The
Value
ofTags
is optional for Lightsail resources.
public java.lang.String getMasterDatabaseName()
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:
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:
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 .
public void setMasterDatabaseName(java.lang.String value)
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:
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:
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 .
public java.lang.String getMasterUsername()
MySQL
Constraints:
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:
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 .
public void setMasterUsername(java.lang.String value)
MySQL
Constraints:
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:
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 .
public java.lang.String getRelationalDatabaseBlueprintId()
public void setRelationalDatabaseBlueprintId(java.lang.String value)
public java.lang.String getRelationalDatabaseBundleId()
public void setRelationalDatabaseBundleId(java.lang.String value)
public java.lang.String getRelationalDatabaseName()
public void setRelationalDatabaseName(java.lang.String value)
public java.lang.String getAvailabilityZone()
public void setAvailabilityZone(java.lang.String value)
public java.lang.Object getBackupRetention()
public void setBackupRetention(java.lang.Boolean value)
public void setBackupRetention(IResolvable value)
public java.lang.String getCaCertificateIdentifier()
public void setCaCertificateIdentifier(java.lang.String value)
public java.lang.String getMasterUserPassword()
The password can include any printable ASCII character except the following: /, ", or @. It cannot contain spaces.
The
MasterUserPassword
andRotateMasterUserPassword
parameters cannot be used together in the same template.
MySQL
Constraints: Must contain 8-41 characters.
PostgreSQL
Constraints: Must contain 8-128 characters.
public void setMasterUserPassword(java.lang.String value)
The password can include any printable ASCII character except the following: /, ", or @. It cannot contain spaces.
The
MasterUserPassword
andRotateMasterUserPassword
parameters cannot be used together in the same template.
MySQL
Constraints: Must contain 8-41 characters.
PostgreSQL
Constraints: Must contain 8-128 characters.
public java.lang.String getPreferredBackupWindow()
public void setPreferredBackupWindow(java.lang.String value)
public java.lang.String getPreferredMaintenanceWindow()
For example, Tue:17:00-Tue:17:30
.
public void setPreferredMaintenanceWindow(java.lang.String value)
For example, Tue:17:00-Tue:17:30
.
public java.lang.Object getPubliclyAccessible()
public void setPubliclyAccessible(java.lang.Boolean value)
public void setPubliclyAccessible(IResolvable value)
public java.lang.Object getRelationalDatabaseParameters()
public void setRelationalDatabaseParameters(IResolvable value)
public void setRelationalDatabaseParameters(java.util.List<java.lang.Object> value)
public java.lang.Object getRotateMasterUserPassword()
The
RotateMasterUserPassword
andMasterUserPassword
parameters cannot be used together in the same template.
public void setRotateMasterUserPassword(java.lang.Boolean value)
The
RotateMasterUserPassword
andMasterUserPassword
parameters cannot be used together in the same template.
public void setRotateMasterUserPassword(IResolvable value)
The
RotateMasterUserPassword
andMasterUserPassword
parameters cannot be used together in the same template.