Class CfnDBCluster

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.97.0 (build 729de35)", date="2024-04-18T17:54:15.292Z") @Stability(Stable) public class CfnDBCluster extends CfnResource implements IInspectable, ITaggable
The AWS::DocDB::DBCluster Amazon DocumentDB (with MongoDB compatibility) resource describes a DBCluster.

Amazon DocumentDB is a fully managed, MongoDB-compatible document database engine. For more information, see DBCluster in the Amazon DocumentDB Developer Guide .

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.docdb.*;
 CfnDBCluster cfnDBCluster = CfnDBCluster.Builder.create(this, "MyCfnDBCluster")
         .availabilityZones(List.of("availabilityZones"))
         .backupRetentionPeriod(123)
         .copyTagsToSnapshot(false)
         .dbClusterIdentifier("dbClusterIdentifier")
         .dbClusterParameterGroupName("dbClusterParameterGroupName")
         .dbSubnetGroupName("dbSubnetGroupName")
         .deletionProtection(false)
         .enableCloudwatchLogsExports(List.of("enableCloudwatchLogsExports"))
         .engineVersion("engineVersion")
         .kmsKeyId("kmsKeyId")
         .masterUsername("masterUsername")
         .masterUserPassword("masterUserPassword")
         .port(123)
         .preferredBackupWindow("preferredBackupWindow")
         .preferredMaintenanceWindow("preferredMaintenanceWindow")
         .restoreToTime("restoreToTime")
         .restoreType("restoreType")
         .snapshotIdentifier("snapshotIdentifier")
         .sourceDbClusterIdentifier("sourceDbClusterIdentifier")
         .storageEncrypted(false)
         .storageType("storageType")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .useLatestRestorableTime(false)
         .vpcSecurityGroupIds(List.of("vpcSecurityGroupIds"))
         .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

    • CfnDBCluster

      protected CfnDBCluster(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnDBCluster

      protected CfnDBCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnDBCluster

      @Stability(Stable) public CfnDBCluster(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnDBClusterProps 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.
    • CfnDBCluster

      @Stability(Stable) public CfnDBCluster(@NotNull software.constructs.Construct scope, @NotNull String id)
      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.
  • 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.
    • getAttrClusterResourceId

      @Stability(Stable) @NotNull public String getAttrClusterResourceId()
      The resource id for the cluster;

      for example: cluster-ABCD1234EFGH5678IJKL90MNOP . The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies.

    • getAttrEndpoint

      @Stability(Stable) @NotNull public String getAttrEndpoint()
      The connection endpoint for the cluster, such as sample-cluster.cluster-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com .
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getAttrPort

      @Stability(Stable) @NotNull public String getAttrPort()
      The port number on which the cluster accepts connections.

      For example: 27017 .

    • getAttrReadEndpoint

      @Stability(Stable) @NotNull public String getAttrReadEndpoint()
      The reader endpoint for the cluster.

      For example: sample-cluster.cluster-ro-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com .

    • 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
    • getAvailabilityZones

      @Stability(Stable) @Nullable public List<String> getAvailabilityZones()
      A list of Amazon EC2 Availability Zones that instances in the cluster can be created in.
    • setAvailabilityZones

      @Stability(Stable) public void setAvailabilityZones(@Nullable List<String> value)
      A list of Amazon EC2 Availability Zones that instances in the cluster can be created in.
    • getBackupRetentionPeriod

      @Stability(Stable) @Nullable public Number getBackupRetentionPeriod()
      The number of days for which automated backups are retained.

      You must specify a minimum value of 1.

    • setBackupRetentionPeriod

      @Stability(Stable) public void setBackupRetentionPeriod(@Nullable Number value)
      The number of days for which automated backups are retained.

      You must specify a minimum value of 1.

    • getCopyTagsToSnapshot

      @Stability(Stable) @Nullable public Object getCopyTagsToSnapshot()
    • setCopyTagsToSnapshot

      @Stability(Stable) public void setCopyTagsToSnapshot(@Nullable Boolean value)
    • setCopyTagsToSnapshot

      @Stability(Stable) public void setCopyTagsToSnapshot(@Nullable IResolvable value)
    • getDbClusterIdentifier

      @Stability(Stable) @Nullable public String getDbClusterIdentifier()
      The cluster identifier.

      This parameter is stored as a lowercase string.

    • setDbClusterIdentifier

      @Stability(Stable) public void setDbClusterIdentifier(@Nullable String value)
      The cluster identifier.

      This parameter is stored as a lowercase string.

    • getDbClusterParameterGroupName

      @Stability(Stable) @Nullable public String getDbClusterParameterGroupName()
      The name of the cluster parameter group to associate with this cluster.
    • setDbClusterParameterGroupName

      @Stability(Stable) public void setDbClusterParameterGroupName(@Nullable String value)
      The name of the cluster parameter group to associate with this cluster.
    • getDbSubnetGroupName

      @Stability(Stable) @Nullable public String getDbSubnetGroupName()
      A subnet group to associate with this cluster.
    • setDbSubnetGroupName

      @Stability(Stable) public void setDbSubnetGroupName(@Nullable String value)
      A subnet group to associate with this cluster.
    • getDeletionProtection

      @Stability(Stable) @Nullable public Object getDeletionProtection()
      Protects clusters from being accidentally deleted.
    • setDeletionProtection

      @Stability(Stable) public void setDeletionProtection(@Nullable Boolean value)
      Protects clusters from being accidentally deleted.
    • setDeletionProtection

      @Stability(Stable) public void setDeletionProtection(@Nullable IResolvable value)
      Protects clusters from being accidentally deleted.
    • getEnableCloudwatchLogsExports

      @Stability(Stable) @Nullable public List<String> getEnableCloudwatchLogsExports()
      The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs.
    • setEnableCloudwatchLogsExports

      @Stability(Stable) public void setEnableCloudwatchLogsExports(@Nullable List<String> value)
      The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs.
    • getEngineVersion

      @Stability(Stable) @Nullable public String getEngineVersion()
      The version number of the database engine to use.
    • setEngineVersion

      @Stability(Stable) public void setEngineVersion(@Nullable String value)
      The version number of the database engine to use.
    • getKmsKeyId

      @Stability(Stable) @Nullable public String getKmsKeyId()
      The AWS KMS key identifier for an encrypted cluster.
    • setKmsKeyId

      @Stability(Stable) public void setKmsKeyId(@Nullable String value)
      The AWS KMS key identifier for an encrypted cluster.
    • getMasterUsername

      @Stability(Stable) @Nullable public String getMasterUsername()
      The name of the master user for the cluster.
    • setMasterUsername

      @Stability(Stable) public void setMasterUsername(@Nullable String value)
      The name of the master user for the cluster.
    • getMasterUserPassword

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

      @Stability(Stable) public void setMasterUserPassword(@Nullable String value)
      The password for the master database user.
    • getPort

      @Stability(Stable) @Nullable public Number getPort()
      Specifies the port that the database engine is listening on.
    • setPort

      @Stability(Stable) public void setPort(@Nullable Number value)
      Specifies the port that the database engine is listening on.
    • getPreferredBackupWindow

      @Stability(Stable) @Nullable public String getPreferredBackupWindow()
      The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.
    • setPreferredBackupWindow

      @Stability(Stable) public void setPreferredBackupWindow(@Nullable String value)
      The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.
    • getPreferredMaintenanceWindow

      @Stability(Stable) @Nullable public String getPreferredMaintenanceWindow()
      The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
    • setPreferredMaintenanceWindow

      @Stability(Stable) public void setPreferredMaintenanceWindow(@Nullable String value)
      The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
    • getRestoreToTime

      @Stability(Stable) @Nullable public String getRestoreToTime()
      The date and time to restore the cluster to.
    • setRestoreToTime

      @Stability(Stable) public void setRestoreToTime(@Nullable String value)
      The date and time to restore the cluster to.
    • getRestoreType

      @Stability(Stable) @Nullable public String getRestoreType()
      The type of restore to be performed.

      You can specify one of the following values:.

    • setRestoreType

      @Stability(Stable) public void setRestoreType(@Nullable String value)
      The type of restore to be performed.

      You can specify one of the following values:.

    • getSnapshotIdentifier

      @Stability(Stable) @Nullable public String getSnapshotIdentifier()
      The identifier for the snapshot or cluster snapshot to restore from.
    • setSnapshotIdentifier

      @Stability(Stable) public void setSnapshotIdentifier(@Nullable String value)
      The identifier for the snapshot or cluster snapshot to restore from.
    • getSourceDbClusterIdentifier

      @Stability(Stable) @Nullable public String getSourceDbClusterIdentifier()
      The identifier of the source cluster from which to restore.
    • setSourceDbClusterIdentifier

      @Stability(Stable) public void setSourceDbClusterIdentifier(@Nullable String value)
      The identifier of the source cluster from which to restore.
    • getStorageEncrypted

      @Stability(Stable) @Nullable public Object getStorageEncrypted()
      Specifies whether the cluster is encrypted.
    • setStorageEncrypted

      @Stability(Stable) public void setStorageEncrypted(@Nullable Boolean value)
      Specifies whether the cluster is encrypted.
    • setStorageEncrypted

      @Stability(Stable) public void setStorageEncrypted(@Nullable IResolvable value)
      Specifies whether the cluster is encrypted.
    • getStorageType

      @Stability(Stable) @Nullable public String getStorageType()
      The storage type to associate with the DB cluster.
    • setStorageType

      @Stability(Stable) public void setStorageType(@Nullable String value)
      The storage type to associate with the DB cluster.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The tags to be assigned to the cluster.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The tags to be assigned to the cluster.
    • getUseLatestRestorableTime

      @Stability(Stable) @Nullable public Object getUseLatestRestorableTime()
      A value that is set to true to restore the cluster to the latest restorable backup time, and false otherwise.
    • setUseLatestRestorableTime

      @Stability(Stable) public void setUseLatestRestorableTime(@Nullable Boolean value)
      A value that is set to true to restore the cluster to the latest restorable backup time, and false otherwise.
    • setUseLatestRestorableTime

      @Stability(Stable) public void setUseLatestRestorableTime(@Nullable IResolvable value)
      A value that is set to true to restore the cluster to the latest restorable backup time, and false otherwise.
    • getVpcSecurityGroupIds

      @Stability(Stable) @Nullable public List<String> getVpcSecurityGroupIds()
      A list of EC2 VPC security groups to associate with this cluster.
    • setVpcSecurityGroupIds

      @Stability(Stable) public void setVpcSecurityGroupIds(@Nullable List<String> value)
      A list of EC2 VPC security groups to associate with this cluster.