Class CfnDatabase
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::Lightsail::Database.
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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnDatabase.static interfaceRelationalDatabaseParameteris a property of the AWS::Lightsail::Database resource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnDatabase(Construct scope, String id, CfnDatabaseProps props) Create a newAWS::Lightsail::Database.protectedCfnDatabase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDatabase(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Resource Name (ARN) of the database (for example,arn:aws:lightsail:us-east-2:123456789101:RelationalDatabase/244ad76f-8aad-4741-809f-12345EXAMPLE).The Availability Zone for the database.A Boolean value indicating whether automated backup retention is enabled for the database.The certificate associated with the database.The meaning of this parameter differs according to the database engine you use.The name for the primary user.The password for the primary user of the database.The daily time range during which automated backups are created for the database (for example,16:00-16:30).The weekly time range during which system maintenance can occur for the database, formatted as follows:ddd:hh24:mi-ddd:hh24:mi.A Boolean value indicating whether the database is accessible to anyone on the internet.The blueprint ID for the database (for example,mysql_8_0).The bundle ID for the database (for example,medium_1_0).The name of the instance.An array of parameters for the database.A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .getTags()An array of key-value pairs to apply to this resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAvailabilityZone(String value) The Availability Zone for the database.voidsetBackupRetention(Boolean value) A Boolean value indicating whether automated backup retention is enabled for the database.voidsetBackupRetention(IResolvable value) A Boolean value indicating whether automated backup retention is enabled for the database.voidsetCaCertificateIdentifier(String value) The certificate associated with the database.voidsetMasterDatabaseName(String value) The meaning of this parameter differs according to the database engine you use.voidsetMasterUsername(String value) The name for the primary user.voidsetMasterUserPassword(String value) The password for the primary user of the database.voidsetPreferredBackupWindow(String value) The daily time range during which automated backups are created for the database (for example,16:00-16:30).voidThe weekly time range during which system maintenance can occur for the database, formatted as follows:ddd:hh24:mi-ddd:hh24:mi.voidsetPubliclyAccessible(Boolean value) A Boolean value indicating whether the database is accessible to anyone on the internet.voidsetPubliclyAccessible(IResolvable value) A Boolean value indicating whether the database is accessible to anyone on the internet.voidThe blueprint ID for the database (for example,mysql_8_0).voidThe bundle ID for the database (for example,medium_1_0).voidsetRelationalDatabaseName(String value) The name of the instance.voidAn array of parameters for the database.voidAn array of parameters for the database.voidA Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .voidA Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnDatabase
protected CfnDatabase(software.amazon.jsii.JsiiObjectRef objRef) -
CfnDatabase
protected CfnDatabase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnDatabase
@Stability(Stable) public CfnDatabase(@NotNull Construct scope, @NotNull String id, @NotNull CfnDatabaseProps props) Create a newAWS::Lightsail::Database.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrDatabaseArn
The Amazon Resource Name (ARN) of the database (for example,arn:aws:lightsail:us-east-2:123456789101:RelationalDatabase/244ad76f-8aad-4741-809f-12345EXAMPLE). -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
An array of key-value pairs to apply to this resource.For more information, see Tag in the AWS CloudFormation User Guide .
The
ValueofTagsis optional for Lightsail resources. -
getMasterDatabaseName
The meaning of this parameter differs according to the database engine you use.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
postgresis 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 .
-
setMasterDatabaseName
The meaning of this parameter differs according to the database engine you use.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
postgresis 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 .
-
getMasterUsername
The name for the primary user.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 .
-
setMasterUsername
The name for the primary user.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 .
-
getRelationalDatabaseBlueprintId
The blueprint ID for the database (for example,mysql_8_0). -
setRelationalDatabaseBlueprintId
The blueprint ID for the database (for example,mysql_8_0). -
getRelationalDatabaseBundleId
The bundle ID for the database (for example,medium_1_0). -
setRelationalDatabaseBundleId
The bundle ID for the database (for example,medium_1_0). -
getRelationalDatabaseName
The name of the instance. -
setRelationalDatabaseName
The name of the instance. -
getAvailabilityZone
The Availability Zone for the database. -
setAvailabilityZone
The Availability Zone for the database. -
getBackupRetention
A Boolean value indicating whether automated backup retention is enabled for the database. -
setBackupRetention
A Boolean value indicating whether automated backup retention is enabled for the database. -
setBackupRetention
A Boolean value indicating whether automated backup retention is enabled for the database. -
getCaCertificateIdentifier
The certificate associated with the database. -
setCaCertificateIdentifier
The certificate associated with the database. -
getMasterUserPassword
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
MasterUserPasswordandRotateMasterUserPasswordparameters cannot be used together in the same template.MySQL
Constraints: Must contain 8-41 characters.
PostgreSQL
Constraints: Must contain 8-128 characters.
-
setMasterUserPassword
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
MasterUserPasswordandRotateMasterUserPasswordparameters cannot be used together in the same template.MySQL
Constraints: Must contain 8-41 characters.
PostgreSQL
Constraints: Must contain 8-128 characters.
-
getPreferredBackupWindow
The daily time range during which automated backups are created for the database (for example,16:00-16:30). -
setPreferredBackupWindow
The daily time range during which automated backups are created for the database (for example,16:00-16:30). -
getPreferredMaintenanceWindow
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. -
setPreferredMaintenanceWindow
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. -
getPubliclyAccessible
A Boolean value indicating whether the database is accessible to anyone on the internet. -
setPubliclyAccessible
A Boolean value indicating whether the database is accessible to anyone on the internet. -
setPubliclyAccessible
A Boolean value indicating whether the database is accessible to anyone on the internet. -
getRelationalDatabaseParameters
An array of parameters for the database. -
setRelationalDatabaseParameters
An array of parameters for the database. -
setRelationalDatabaseParameters
An array of parameters for the database. -
getRotateMasterUserPassword
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .The
RotateMasterUserPasswordandMasterUserPasswordparameters cannot be used together in the same template. -
setRotateMasterUserPassword
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .The
RotateMasterUserPasswordandMasterUserPasswordparameters cannot be used together in the same template. -
setRotateMasterUserPassword
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .The
RotateMasterUserPasswordandMasterUserPasswordparameters cannot be used together in the same template.
-