@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-27T16:28:01.839Z") public class CfnDBCluster extends CfnResource implements IInspectable
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") .snapshotIdentifier("snapshotIdentifier") .storageEncrypted(false) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .vpcSecurityGroupIds(List.of("vpcSecurityGroupIds")) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnDBCluster.Builder
A fluent builder for
CfnDBCluster . |
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 |
---|---|
|
CfnDBCluster(Construct scope,
java.lang.String id)
Create a new `AWS::DocDB::DBCluster`.
|
|
CfnDBCluster(Construct scope,
java.lang.String id,
CfnDBClusterProps props)
Create a new `AWS::DocDB::DBCluster`.
|
protected |
CfnDBCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnDBCluster(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrClusterResourceId()
The resource id for the cluster;
|
java.lang.String |
getAttrEndpoint()
The connection endpoint for the cluster, such as `sample-cluster.cluster-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com` .
|
java.lang.String |
getAttrPort()
The port number on which the cluster accepts connections.
|
java.lang.String |
getAttrReadEndpoint()
The reader endpoint for the cluster.
|
java.util.List<java.lang.String> |
getAvailabilityZones()
A list of Amazon EC2 Availability Zones that instances in the cluster can be created in.
|
java.lang.Number |
getBackupRetentionPeriod()
The number of days for which automated backups are retained.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getCopyTagsToSnapshot()
`AWS::DocDB::DBCluster.CopyTagsToSnapshot`.
|
java.lang.String |
getDbClusterIdentifier()
The cluster identifier.
|
java.lang.String |
getDbClusterParameterGroupName()
The name of the cluster parameter group to associate with this cluster.
|
java.lang.String |
getDbSubnetGroupName()
A subnet group to associate with this cluster.
|
java.lang.Object |
getDeletionProtection()
Protects clusters from being accidentally deleted.
|
java.util.List<java.lang.String> |
getEnableCloudwatchLogsExports()
The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs.
|
java.lang.String |
getEngineVersion()
The version number of the database engine to use.
|
java.lang.String |
getKmsKeyId()
The AWS KMS key identifier for an encrypted cluster.
|
java.lang.String |
getMasterUsername()
The name of the master user for the cluster.
|
java.lang.String |
getMasterUserPassword()
The password for the master database user.
|
java.lang.Number |
getPort()
Specifies the port that the database engine is listening on.
|
java.lang.String |
getPreferredBackupWindow()
The daily time range during which automated backups are created if automated backups are enabled using the `BackupRetentionPeriod` parameter.
|
java.lang.String |
getPreferredMaintenanceWindow()
The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
|
java.lang.String |
getSnapshotIdentifier()
The identifier for the snapshot or cluster snapshot to restore from.
|
java.lang.Object |
getStorageEncrypted()
Specifies whether the cluster is encrypted.
|
TagManager |
getTags()
The tags to be assigned to the cluster.
|
java.util.List<java.lang.String> |
getVpcSecurityGroupIds()
A list of EC2 VPC security groups to associate with this cluster.
|
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 |
setAvailabilityZones(java.util.List<java.lang.String> value)
A list of Amazon EC2 Availability Zones that instances in the cluster can be created in.
|
void |
setBackupRetentionPeriod(java.lang.Number value)
The number of days for which automated backups are retained.
|
void |
setCopyTagsToSnapshot(java.lang.Boolean value)
`AWS::DocDB::DBCluster.CopyTagsToSnapshot`.
|
void |
setCopyTagsToSnapshot(IResolvable value)
`AWS::DocDB::DBCluster.CopyTagsToSnapshot`.
|
void |
setDbClusterIdentifier(java.lang.String value)
The cluster identifier.
|
void |
setDbClusterParameterGroupName(java.lang.String value)
The name of the cluster parameter group to associate with this cluster.
|
void |
setDbSubnetGroupName(java.lang.String value)
A subnet group to associate with this cluster.
|
void |
setDeletionProtection(java.lang.Boolean value)
Protects clusters from being accidentally deleted.
|
void |
setDeletionProtection(IResolvable value)
Protects clusters from being accidentally deleted.
|
void |
setEnableCloudwatchLogsExports(java.util.List<java.lang.String> value)
The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs.
|
void |
setEngineVersion(java.lang.String value)
The version number of the database engine to use.
|
void |
setKmsKeyId(java.lang.String value)
The AWS KMS key identifier for an encrypted cluster.
|
void |
setMasterUsername(java.lang.String value)
The name of the master user for the cluster.
|
void |
setMasterUserPassword(java.lang.String value)
The password for the master database user.
|
void |
setPort(java.lang.Number value)
Specifies the port that the database engine is listening on.
|
void |
setPreferredBackupWindow(java.lang.String value)
The daily time range during which automated backups are created if automated backups are enabled using the `BackupRetentionPeriod` parameter.
|
void |
setPreferredMaintenanceWindow(java.lang.String value)
The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
|
void |
setSnapshotIdentifier(java.lang.String value)
The identifier for the snapshot or cluster snapshot to restore from.
|
void |
setStorageEncrypted(java.lang.Boolean value)
Specifies whether the cluster is encrypted.
|
void |
setStorageEncrypted(IResolvable value)
Specifies whether the cluster is encrypted.
|
void |
setVpcSecurityGroupIds(java.util.List<java.lang.String> value)
A list of EC2 VPC security groups to associate with this cluster.
|
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 CfnDBCluster(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnDBCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnDBCluster(Construct scope, java.lang.String id, CfnDBClusterProps 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.public CfnDBCluster(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. 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 getAttrClusterResourceId()
for example: cluster-ABCD1234EFGH5678IJKL90MNOP
. The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies.
public java.lang.String getAttrEndpoint()
public java.lang.String getAttrPort()
For example: 27017
.
public java.lang.String getAttrReadEndpoint()
For example: sample-cluster.cluster-ro-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.util.List<java.lang.String> getAvailabilityZones()
public void setAvailabilityZones(java.util.List<java.lang.String> value)
public java.lang.Number getBackupRetentionPeriod()
Default: 1
Constraints:
public void setBackupRetentionPeriod(java.lang.Number value)
Default: 1
Constraints:
public java.lang.Object getCopyTagsToSnapshot()
public void setCopyTagsToSnapshot(java.lang.Boolean value)
public void setCopyTagsToSnapshot(IResolvable value)
public java.lang.String getDbClusterIdentifier()
Constraints:
Example: my-cluster
public void setDbClusterIdentifier(java.lang.String value)
Constraints:
Example: my-cluster
public java.lang.String getDbClusterParameterGroupName()
public void setDbClusterParameterGroupName(java.lang.String value)
public java.lang.String getDbSubnetGroupName()
Constraints: Must match the name of an existing DBSubnetGroup
. Must not be default.
Example: mySubnetgroup
public void setDbSubnetGroupName(java.lang.String value)
Constraints: Must match the name of an existing DBSubnetGroup
. Must not be default.
Example: mySubnetgroup
public java.lang.Object getDeletionProtection()
If enabled, the cluster cannot be deleted unless it is modified and DeletionProtection
is disabled.
public void setDeletionProtection(java.lang.Boolean value)
If enabled, the cluster cannot be deleted unless it is modified and DeletionProtection
is disabled.
public void setDeletionProtection(IResolvable value)
If enabled, the cluster cannot be deleted unless it is modified and DeletionProtection
is disabled.
public java.util.List<java.lang.String> getEnableCloudwatchLogsExports()
You can enable audit logs or profiler logs. For more information, see Auditing Amazon DocumentDB Events and Profiling Amazon DocumentDB Operations .
public void setEnableCloudwatchLogsExports(java.util.List<java.lang.String> value)
You can enable audit logs or profiler logs. For more information, see Auditing Amazon DocumentDB Events and Profiling Amazon DocumentDB Operations .
public java.lang.String getEngineVersion()
The --engine-version
will default to the latest major engine version. For production workloads, we recommend explicitly declaring this parameter with the intended major engine version.
public void setEngineVersion(java.lang.String value)
The --engine-version
will default to the latest major engine version. For production workloads, we recommend explicitly declaring this parameter with the intended major engine version.
public java.lang.String getKmsKeyId()
The AWS KMS key identifier is the Amazon Resource Name (ARN) for the AWS KMS encryption key. If you are creating a cluster using the same AWS account that owns the AWS KMS encryption key that is used to encrypt the new cluster, you can use the AWS KMS key alias instead of the ARN for the AWS KMS encryption key.
If an encryption key is not specified in KmsKeyId
:
StorageEncrypted
parameter is true
, Amazon DocumentDB uses your default encryption key.AWS KMS creates the default encryption key for your AWS account . Your AWS account has a different default encryption key for each AWS Regions .
public void setKmsKeyId(java.lang.String value)
The AWS KMS key identifier is the Amazon Resource Name (ARN) for the AWS KMS encryption key. If you are creating a cluster using the same AWS account that owns the AWS KMS encryption key that is used to encrypt the new cluster, you can use the AWS KMS key alias instead of the ARN for the AWS KMS encryption key.
If an encryption key is not specified in KmsKeyId
:
StorageEncrypted
parameter is true
, Amazon DocumentDB uses your default encryption key.AWS KMS creates the default encryption key for your AWS account . Your AWS account has a different default encryption key for each AWS Regions .
public java.lang.String getMasterUsername()
Constraints:
public void setMasterUsername(java.lang.String value)
Constraints:
public java.lang.String getMasterUserPassword()
This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@).
Constraints: Must contain from 8 to 100 characters.
public void setMasterUserPassword(java.lang.String value)
This password can contain any printable ASCII character except forward slash (/), double quote ("), or the "at" symbol (@).
Constraints: Must contain from 8 to 100 characters.
public java.lang.Number getPort()
public void setPort(java.lang.Number value)
public java.lang.String getPreferredBackupWindow()
The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region .
Constraints:
hh24:mi-hh24:mi
.public void setPreferredBackupWindow(java.lang.String value)
The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region .
Constraints:
hh24:mi-hh24:mi
.public java.lang.String getPreferredMaintenanceWindow()
Format: ddd:hh24:mi-ddd:hh24:mi
The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region , occurring on a random day of the week.
Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
Constraints: Minimum 30-minute window.
public void setPreferredMaintenanceWindow(java.lang.String value)
Format: ddd:hh24:mi-ddd:hh24:mi
The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region , occurring on a random day of the week.
Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun
Constraints: Minimum 30-minute window.
public java.lang.String getSnapshotIdentifier()
You can use either the name or the Amazon Resource Name (ARN) to specify a cluster snapshot. However, you can use only the ARN to specify a snapshot.
Constraints:
public void setSnapshotIdentifier(java.lang.String value)
You can use either the name or the Amazon Resource Name (ARN) to specify a cluster snapshot. However, you can use only the ARN to specify a snapshot.
Constraints:
public java.lang.Object getStorageEncrypted()
public void setStorageEncrypted(java.lang.Boolean value)
public void setStorageEncrypted(IResolvable value)
public java.util.List<java.lang.String> getVpcSecurityGroupIds()
public void setVpcSecurityGroupIds(java.util.List<java.lang.String> value)