Class CfnDBCluster
- All Implemented Interfaces:
IEnvironmentAware,IInspectable,ITaggable,IDBClusterRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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")
.globalClusterIdentifier("globalClusterIdentifier")
.kmsKeyId("kmsKeyId")
.manageMasterUserPassword(false)
.masterUsername("masterUsername")
.masterUserPassword("masterUserPassword")
.masterUserSecretKmsKeyId("masterUserSecretKmsKeyId")
.networkType("networkType")
.port(123)
.preferredBackupWindow("preferredBackupWindow")
.preferredMaintenanceWindow("preferredMaintenanceWindow")
.restoreToTime("restoreToTime")
.restoreType("restoreType")
.rotateMasterUserPassword(false)
.serverlessV2ScalingConfiguration(ServerlessV2ScalingConfigurationProperty.builder()
.maxCapacity(123)
.minCapacity(123)
.build())
.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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnDBCluster.static interfaceSets the scaling configuration of an Amazon DocumentDB Serverless cluster.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.services.docdb.IDBClusterRef
IDBClusterRef.Jsii$Default, IDBClusterRef.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
ConstructorsModifierConstructorDescriptionprotectedCfnDBCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDBCluster(software.amazon.jsii.JsiiObjectRef objRef) CfnDBCluster(software.constructs.Construct scope, String id) CfnDBCluster(software.constructs.Construct scope, String id, CfnDBClusterProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe resource id for the cluster;The connection endpoint for the cluster, such assample-cluster---cluster-cozrlsfrcjoc---us-east-1---docdb.amazonaws.com.rproxy.govskope.ca.The port number on which the cluster accepts connections.The reader endpoint for the cluster.A list of Amazon EC2 Availability Zones that instances in the cluster can be created in.The number of days for which automated backups are retained.Set totrueto copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwisefalse.The cluster identifier.The name of the cluster parameter group to associate with this cluster.A reference to a DBCluster resource.A subnet group to associate with this cluster.Protects clusters from being accidentally deleted.The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs.The version number of the database engine to use.The cluster identifier of the new global cluster.The AWS KMS key identifier for an encrypted cluster.Specifies whether to manage the master user password with Amazon Web Services Secrets Manager.The name of the master user for the cluster.The password for the master database user.The Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager.The network type of the cluster.getPort()Specifies the port that the database engine is listening on.The daily time range during which automated backups are created if automated backups are enabled using theBackupRetentionPeriodparameter.The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).The date and time to restore the cluster to.The type of restore to be performed.Specifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password.Contains the scaling configuration of an Amazon DocumentDB Serverless cluster.The identifier for the snapshot or cluster snapshot to restore from.The identifier of the source cluster from which to restore.Specifies whether the cluster is encrypted.The storage type to associate with the DB cluster.getTags()Tag Manager which manages the tags for this resource.The tags to be assigned to the cluster.A value that is set totrueto restore the cluster to the latest restorable backup time, andfalseotherwise.A list of EC2 VPC security groups to associate with this cluster.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAvailabilityZones(List<String> value) A list of Amazon EC2 Availability Zones that instances in the cluster can be created in.voidsetBackupRetentionPeriod(Number value) The number of days for which automated backups are retained.voidsetCopyTagsToSnapshot(Boolean value) Set totrueto copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwisefalse.voidsetCopyTagsToSnapshot(IResolvable value) Set totrueto copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwisefalse.voidsetDbClusterIdentifier(String value) The cluster identifier.voidThe name of the cluster parameter group to associate with this cluster.voidsetDbSubnetGroupName(String value) A subnet group to associate with this cluster.voidsetDeletionProtection(Boolean value) Protects clusters from being accidentally deleted.voidsetDeletionProtection(IResolvable value) Protects clusters from being accidentally deleted.voidsetEnableCloudwatchLogsExports(List<String> value) The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs.voidsetEngineVersion(String value) The version number of the database engine to use.voidsetGlobalClusterIdentifier(String value) The cluster identifier of the new global cluster.voidsetKmsKeyId(String value) The AWS KMS key identifier for an encrypted cluster.voidSpecifies whether to manage the master user password with Amazon Web Services Secrets Manager.voidSpecifies whether to manage the master user password with Amazon Web Services Secrets Manager.voidsetMasterUsername(String value) The name of the master user for the cluster.voidsetMasterUserPassword(String value) The password for the master database user.voidThe Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager.voidsetNetworkType(String value) The network type of the cluster.voidSpecifies the port that the database engine is listening on.voidsetPreferredBackupWindow(String value) The daily time range during which automated backups are created if automated backups are enabled using theBackupRetentionPeriodparameter.voidThe weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).voidsetRestoreToTime(String value) The date and time to restore the cluster to.voidsetRestoreType(String value) The type of restore to be performed.voidSpecifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password.voidSpecifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password.voidContains the scaling configuration of an Amazon DocumentDB Serverless cluster.voidContains the scaling configuration of an Amazon DocumentDB Serverless cluster.voidsetSnapshotIdentifier(String value) The identifier for the snapshot or cluster snapshot to restore from.voidThe identifier of the source cluster from which to restore.voidsetStorageEncrypted(Boolean value) Specifies whether the cluster is encrypted.voidsetStorageEncrypted(IResolvable value) Specifies whether the cluster is encrypted.voidsetStorageType(String value) The storage type to associate with the DB cluster.voidsetTagsRaw(List<CfnTag> value) The tags to be assigned to the cluster.voidA value that is set totrueto restore the cluster to the latest restorable backup time, andfalseotherwise.voidA value that is set totrueto restore the cluster to the latest restorable backup time, andfalseotherwise.voidsetVpcSecurityGroupIds(List<String> value) A list of EC2 VPC security groups to associate with this cluster.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.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
-
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
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.
-
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
The connection endpoint for the cluster, such assample-cluster.cluster-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com. -
getAttrId
-
getAttrPort
The port number on which the cluster accepts connections.For example:
27017. -
getAttrReadEndpoint
The reader endpoint for the cluster.For example:
sample-cluster.cluster-ro-cozrlsfrcjoc.us-east-1.docdb.amazonaws.com. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getDbClusterRef
A reference to a DBCluster resource.- Specified by:
getDbClusterRefin interfaceIDBClusterRef
-
getTags
Tag Manager which manages the tags for this resource. -
getAvailabilityZones
A list of Amazon EC2 Availability Zones that instances in the cluster can be created in. -
setAvailabilityZones
A list of Amazon EC2 Availability Zones that instances in the cluster can be created in. -
getBackupRetentionPeriod
The number of days for which automated backups are retained.You must specify a minimum value of 1.
-
setBackupRetentionPeriod
The number of days for which automated backups are retained.You must specify a minimum value of 1.
-
getCopyTagsToSnapshot
Set totrueto copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwisefalse.Returns union: either
BooleanorIResolvable -
setCopyTagsToSnapshot
Set totrueto copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwisefalse. -
setCopyTagsToSnapshot
Set totrueto copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwisefalse. -
getDbClusterIdentifier
The cluster identifier.This parameter is stored as a lowercase string.
-
setDbClusterIdentifier
The cluster identifier.This parameter is stored as a lowercase string.
-
getDbClusterParameterGroupName
The name of the cluster parameter group to associate with this cluster. -
setDbClusterParameterGroupName
The name of the cluster parameter group to associate with this cluster. -
getDbSubnetGroupName
A subnet group to associate with this cluster. -
setDbSubnetGroupName
A subnet group to associate with this cluster. -
getDeletionProtection
Protects clusters from being accidentally deleted.Returns union: either
BooleanorIResolvable -
setDeletionProtection
Protects clusters from being accidentally deleted. -
setDeletionProtection
Protects clusters from being accidentally deleted. -
getEnableCloudwatchLogsExports
The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs. -
setEnableCloudwatchLogsExports
The list of log types that need to be enabled for exporting to Amazon CloudWatch Logs. -
getEngineVersion
The version number of the database engine to use. -
setEngineVersion
The version number of the database engine to use. -
getGlobalClusterIdentifier
The cluster identifier of the new global cluster. -
setGlobalClusterIdentifier
The cluster identifier of the new global cluster. -
getKmsKeyId
The AWS KMS key identifier for an encrypted cluster. -
setKmsKeyId
The AWS KMS key identifier for an encrypted cluster. -
getManageMasterUserPassword
Specifies whether to manage the master user password with Amazon Web Services Secrets Manager.Returns union: either
BooleanorIResolvable -
setManageMasterUserPassword
Specifies whether to manage the master user password with Amazon Web Services Secrets Manager. -
setManageMasterUserPassword
Specifies whether to manage the master user password with Amazon Web Services Secrets Manager. -
getMasterUsername
The name of the master user for the cluster. -
setMasterUsername
The name of the master user for the cluster. -
getMasterUserPassword
The password for the master database user. -
setMasterUserPassword
The password for the master database user. -
getMasterUserSecretKmsKeyId
The Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager. -
setMasterUserSecretKmsKeyId
The Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager. -
getNetworkType
The network type of the cluster. -
setNetworkType
The network type of the cluster. -
getPort
Specifies the port that the database engine is listening on. -
setPort
Specifies the port that the database engine is listening on. -
getPreferredBackupWindow
The daily time range during which automated backups are created if automated backups are enabled using theBackupRetentionPeriodparameter. -
setPreferredBackupWindow
The daily time range during which automated backups are created if automated backups are enabled using theBackupRetentionPeriodparameter. -
getPreferredMaintenanceWindow
The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). -
setPreferredMaintenanceWindow
The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). -
getRestoreToTime
The date and time to restore the cluster to. -
setRestoreToTime
The date and time to restore the cluster to. -
getRestoreType
The type of restore to be performed.You can specify one of the following values:.
-
setRestoreType
The type of restore to be performed.You can specify one of the following values:.
-
getRotateMasterUserPassword
Specifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password.Returns union: either
BooleanorIResolvable -
setRotateMasterUserPassword
Specifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password. -
setRotateMasterUserPassword
Specifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password. -
getServerlessV2ScalingConfiguration
Contains the scaling configuration of an Amazon DocumentDB Serverless cluster.Returns union: either
IResolvableorCfnDBCluster.ServerlessV2ScalingConfigurationProperty -
setServerlessV2ScalingConfiguration
Contains the scaling configuration of an Amazon DocumentDB Serverless cluster. -
setServerlessV2ScalingConfiguration
@Stability(Stable) public void setServerlessV2ScalingConfiguration(@Nullable CfnDBCluster.ServerlessV2ScalingConfigurationProperty value) Contains the scaling configuration of an Amazon DocumentDB Serverless cluster. -
getSnapshotIdentifier
The identifier for the snapshot or cluster snapshot to restore from. -
setSnapshotIdentifier
The identifier for the snapshot or cluster snapshot to restore from. -
getSourceDbClusterIdentifier
The identifier of the source cluster from which to restore. -
setSourceDbClusterIdentifier
The identifier of the source cluster from which to restore. -
getStorageEncrypted
Specifies whether the cluster is encrypted.Returns union: either
BooleanorIResolvable -
setStorageEncrypted
Specifies whether the cluster is encrypted. -
setStorageEncrypted
Specifies whether the cluster is encrypted. -
getStorageType
The storage type to associate with the DB cluster. -
setStorageType
The storage type to associate with the DB cluster. -
getTagsRaw
The tags to be assigned to the cluster. -
setTagsRaw
The tags to be assigned to the cluster. -
getUseLatestRestorableTime
A value that is set totrueto restore the cluster to the latest restorable backup time, andfalseotherwise.Returns union: either
BooleanorIResolvable -
setUseLatestRestorableTime
A value that is set totrueto restore the cluster to the latest restorable backup time, andfalseotherwise. -
setUseLatestRestorableTime
A value that is set totrueto restore the cluster to the latest restorable backup time, andfalseotherwise. -
getVpcSecurityGroupIds
A list of EC2 VPC security groups to associate with this cluster. -
setVpcSecurityGroupIds
A list of EC2 VPC security groups to associate with this cluster.
-