Class CfnDatabase

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:04.645Z") @Stability(Stable) public class CfnDatabase extends CfnResource implements IInspectable, 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:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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)
      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

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrDatabaseArn

      @Stability(Stable) @NotNull public 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 ).
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getMasterDatabaseName

      @Stability(Stable) @NotNull public String getMasterDatabaseName()
      The meaning of this parameter differs according to the database engine you use.
    • setMasterDatabaseName

      @Stability(Stable) public void setMasterDatabaseName(@NotNull String value)
      The meaning of this parameter differs according to the database engine you use.
    • getMasterUsername

      @Stability(Stable) @NotNull public String getMasterUsername()
      The name for the primary user.
    • setMasterUsername

      @Stability(Stable) public void setMasterUsername(@NotNull String value)
      The name for the primary user.
    • getRelationalDatabaseBlueprintId

      @Stability(Stable) @NotNull public String getRelationalDatabaseBlueprintId()
      The blueprint ID for the database (for example, mysql_8_0 ).
    • setRelationalDatabaseBlueprintId

      @Stability(Stable) public void setRelationalDatabaseBlueprintId(@NotNull String value)
      The blueprint ID for the database (for example, mysql_8_0 ).
    • getRelationalDatabaseBundleId

      @Stability(Stable) @NotNull public String getRelationalDatabaseBundleId()
      The bundle ID for the database (for example, medium_1_0 ).
    • setRelationalDatabaseBundleId

      @Stability(Stable) public void setRelationalDatabaseBundleId(@NotNull String value)
      The bundle ID for the database (for example, medium_1_0 ).
    • getRelationalDatabaseName

      @Stability(Stable) @NotNull public String getRelationalDatabaseName()
      The name of the instance.
    • setRelationalDatabaseName

      @Stability(Stable) public void setRelationalDatabaseName(@NotNull String value)
      The name of the instance.
    • getAvailabilityZone

      @Stability(Stable) @Nullable public String getAvailabilityZone()
      The Availability Zone for the database.
    • setAvailabilityZone

      @Stability(Stable) public void setAvailabilityZone(@Nullable String value)
      The Availability Zone for the database.
    • getBackupRetention

      @Stability(Stable) @Nullable public Object getBackupRetention()
      A Boolean value indicating whether automated backup retention is enabled for the database.
    • setBackupRetention

      @Stability(Stable) public void setBackupRetention(@Nullable Boolean value)
      A Boolean value indicating whether automated backup retention is enabled for the database.
    • setBackupRetention

      @Stability(Stable) public void setBackupRetention(@Nullable IResolvable value)
      A Boolean value indicating whether automated backup retention is enabled for the database.
    • getCaCertificateIdentifier

      @Stability(Stable) @Nullable public String getCaCertificateIdentifier()
      The certificate associated with the database.
    • setCaCertificateIdentifier

      @Stability(Stable) public void setCaCertificateIdentifier(@Nullable String value)
      The certificate associated with the database.
    • getMasterUserPassword

      @Stability(Stable) @Nullable public String getMasterUserPassword()
      The password for the primary user of the database.
    • setMasterUserPassword

      @Stability(Stable) public void setMasterUserPassword(@Nullable String value)
      The password for the primary user of the database.
    • getPreferredBackupWindow

      @Stability(Stable) @Nullable public String getPreferredBackupWindow()
      The daily time range during which automated backups are created for the database (for example, 16:00-16:30 ).
    • setPreferredBackupWindow

      @Stability(Stable) public void setPreferredBackupWindow(@Nullable String value)
      The daily time range during which automated backups are created for the database (for example, 16:00-16:30 ).
    • getPreferredMaintenanceWindow

      @Stability(Stable) @Nullable public String getPreferredMaintenanceWindow()
      The weekly time range during which system maintenance can occur for the database, formatted as follows: ddd:hh24:mi-ddd:hh24:mi .
    • setPreferredMaintenanceWindow

      @Stability(Stable) public void setPreferredMaintenanceWindow(@Nullable String value)
      The weekly time range during which system maintenance can occur for the database, formatted as follows: ddd:hh24:mi-ddd:hh24:mi .
    • getPubliclyAccessible

      @Stability(Stable) @Nullable public Object getPubliclyAccessible()
      A Boolean value indicating whether the database is accessible to anyone on the internet.
    • setPubliclyAccessible

      @Stability(Stable) public void setPubliclyAccessible(@Nullable Boolean value)
      A Boolean value indicating whether the database is accessible to anyone on the internet.
    • setPubliclyAccessible

      @Stability(Stable) public void setPubliclyAccessible(@Nullable IResolvable value)
      A Boolean value indicating whether the database is accessible to anyone on the internet.
    • getRelationalDatabaseParameters

      @Stability(Stable) @Nullable public Object getRelationalDatabaseParameters()
      An array of parameters for the database.
    • setRelationalDatabaseParameters

      @Stability(Stable) public void setRelationalDatabaseParameters(@Nullable IResolvable value)
      An array of parameters for the database.
    • setRelationalDatabaseParameters

      @Stability(Stable) public void setRelationalDatabaseParameters(@Nullable List<Object> value)
      An array of parameters for the database.
    • getRotateMasterUserPassword

      @Stability(Stable) @Nullable public Object getRotateMasterUserPassword()
      A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
    • setRotateMasterUserPassword

      @Stability(Stable) public void setRotateMasterUserPassword(@Nullable Boolean value)
      A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
    • setRotateMasterUserPassword

      @Stability(Stable) public void setRotateMasterUserPassword(@Nullable IResolvable value)
      A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      An array of key-value pairs to apply to this resource.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      An array of key-value pairs to apply to this resource.