Class CfnDatabase
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.lightsail.CfnDatabase
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IDatabaseRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)",
date="2025-12-18T18:20:13.047Z")
@Stability(Stable)
public class CfnDatabase
extends CfnResource
implements IInspectable, IDatabaseRef, ITaggable
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();
- See Also:
-
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.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.lightsail.IDatabaseRef
IDatabaseRef.Jsii$Default, IDatabaseRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnDatabase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDatabase(software.amazon.jsii.JsiiObjectRef objRef) CfnDatabase(software.constructs.Construct scope, String id, CfnDatabaseProps props) Create a newAWS::Lightsail::Database. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForDatabase(IDatabaseRef resource) The 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.A reference to a Database resource.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()Tag Manager which manages the tags for this resource.An array of key-value pairs to apply to this resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnDatabase.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 .voidsetTagsRaw(List<CfnTag> value) An array of key-value pairs to apply to this resource.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnDatabaseProps props) Create a newAWS::Lightsail::Database.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForDatabase
- Parameters:
resource- This parameter is required.
-
isCfnDatabase
Checks whether the given object is a CfnDatabase.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
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
-
getDatabaseRef
A reference to a Database resource.- Specified by:
getDatabaseRefin interfaceIDatabaseRef
-
getTags
Tag Manager which manages the tags for this resource. -
getMasterDatabaseName
The meaning of this parameter differs according to the database engine you use. -
setMasterDatabaseName
The meaning of this parameter differs according to the database engine you use. -
getMasterUsername
The name for the primary user. -
setMasterUsername
The name for the primary user. -
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.Returns union: either
BooleanorIResolvable -
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. -
setMasterUserPassword
The password for the primary user of the database. -
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. -
setPreferredMaintenanceWindow
The weekly time range during which system maintenance can occur for the database, formatted as follows:ddd:hh24:mi-ddd:hh24:mi. -
getPubliclyAccessible
A Boolean value indicating whether the database is accessible to anyone on the internet.Returns union: either
BooleanorIResolvable -
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.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnDatabase.RelationalDatabaseParameterProperty> -
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 .Returns union: either
BooleanorIResolvable -
setRotateMasterUserPassword
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail . -
setRotateMasterUserPassword
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail . -
getTagsRaw
An array of key-value pairs to apply to this resource. -
setTagsRaw
An array of key-value pairs to apply to this resource.
-