CfnDBClusterProps Struct
Properties for defining a CfnDBCluster.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_docdb as docdb } from 'aws-cdk-lib';
const cfnDBClusterProps: docdb.CfnDBClusterProps = {
availabilityZones: ['availabilityZones'],
backupRetentionPeriod: 123,
copyTagsToSnapshot: false,
dbClusterIdentifier: 'dbClusterIdentifier',
dbClusterParameterGroupName: 'dbClusterParameterGroupName',
dbSubnetGroupName: 'dbSubnetGroupName',
deletionProtection: false,
enableCloudwatchLogsExports: ['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: {
maxCapacity: 123,
minCapacity: 123,
},
snapshotIdentifier: 'snapshotIdentifier',
sourceDbClusterIdentifier: 'sourceDbClusterIdentifier',
storageEncrypted: false,
storageType: 'storageType',
tags: [{
key: 'key',
value: 'value',
}],
useLatestRestorableTime: false,
vpcSecurityGroupIds: ['vpcSecurityGroupIds'],
};
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_docdb as docdb
cfn_db_cluster_props = docdb.CfnDBClusterProps(
availability_zones=["availabilityZones"],
backup_retention_period=123,
copy_tags_to_snapshot=False,
db_cluster_identifier="dbClusterIdentifier",
db_cluster_parameter_group_name="dbClusterParameterGroupName",
db_subnet_group_name="dbSubnetGroupName",
deletion_protection=False,
enable_cloudwatch_logs_exports=["enableCloudwatchLogsExports"],
engine_version="engineVersion",
global_cluster_identifier="globalClusterIdentifier",
kms_key_id="kmsKeyId",
manage_master_user_password=False,
master_username="masterUsername",
master_user_password="masterUserPassword",
master_user_secret_kms_key_id="masterUserSecretKmsKeyId",
network_type="networkType",
port=123,
preferred_backup_window="preferredBackupWindow",
preferred_maintenance_window="preferredMaintenanceWindow",
restore_to_time="restoreToTime",
restore_type="restoreType",
rotate_master_user_password=False,
serverless_v2_scaling_configuration=docdb.CfnDBCluster.ServerlessV2ScalingConfigurationProperty(
max_capacity=123,
min_capacity=123
),
snapshot_identifier="snapshotIdentifier",
source_db_cluster_identifier="sourceDbClusterIdentifier",
storage_encrypted=False,
storage_type="storageType",
tags=[CfnTag(
key="key",
value="value"
)],
use_latest_restorable_time=False,
vpc_security_group_ids=["vpcSecurityGroupIds"]
)
// 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.*;
CfnDBClusterProps cfnDBClusterProps = CfnDBClusterProps.builder()
.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();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DocDB;
var cfnDBClusterProps = new CfnDBClusterProps {
AvailabilityZones = new [] { "availabilityZones" },
BackupRetentionPeriod = 123,
CopyTagsToSnapshot = false,
DbClusterIdentifier = "dbClusterIdentifier",
DbClusterParameterGroupName = "dbClusterParameterGroupName",
DbSubnetGroupName = "dbSubnetGroupName",
DeletionProtection = false,
EnableCloudwatchLogsExports = new [] { "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 = new ServerlessV2ScalingConfigurationProperty {
MaxCapacity = 123,
MinCapacity = 123
},
SnapshotIdentifier = "snapshotIdentifier",
SourceDbClusterIdentifier = "sourceDbClusterIdentifier",
StorageEncrypted = false,
StorageType = "storageType",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
UseLatestRestorableTime = false,
VpcSecurityGroupIds = new [] { "vpcSecurityGroupIds" }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnDBClusterProps := &CfnDBClusterProps{
AvailabilityZones: []*string{
jsii.String("availabilityZones"),
},
BackupRetentionPeriod: jsii.Number(123),
CopyTagsToSnapshot: jsii.Boolean(false),
DbClusterIdentifier: jsii.String("dbClusterIdentifier"),
DbClusterParameterGroupName: jsii.String("dbClusterParameterGroupName"),
DbSubnetGroupName: jsii.String("dbSubnetGroupName"),
DeletionProtection: jsii.Boolean(false),
EnableCloudwatchLogsExports: []*string{
jsii.String("enableCloudwatchLogsExports"),
},
EngineVersion: jsii.String("engineVersion"),
GlobalClusterIdentifier: jsii.String("globalClusterIdentifier"),
KmsKeyId: jsii.String("kmsKeyId"),
ManageMasterUserPassword: jsii.Boolean(false),
MasterUsername: jsii.String("masterUsername"),
MasterUserPassword: jsii.String("masterUserPassword"),
MasterUserSecretKmsKeyId: jsii.String("masterUserSecretKmsKeyId"),
NetworkType: jsii.String("networkType"),
Port: jsii.Number(123),
PreferredBackupWindow: jsii.String("preferredBackupWindow"),
PreferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"),
RestoreToTime: jsii.String("restoreToTime"),
RestoreType: jsii.String("restoreType"),
RotateMasterUserPassword: jsii.Boolean(false),
ServerlessV2ScalingConfiguration: &ServerlessV2ScalingConfigurationProperty{
MaxCapacity: jsii.Number(123),
MinCapacity: jsii.Number(123),
},
SnapshotIdentifier: jsii.String("snapshotIdentifier"),
SourceDbClusterIdentifier: jsii.String("sourceDbClusterIdentifier"),
StorageEncrypted: jsii.Boolean(false),
StorageType: jsii.String("storageType"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
UseLatestRestorableTime: jsii.Boolean(false),
VpcSecurityGroupIds: []*string{
jsii.String("vpcSecurityGroupIds"),
},
}
Properties
availabilityZonesoptionalstring[]availability_zonesoptionaltyping.List[str]availabilityZonesoptionalList<String>AvailabilityZonesoptionalstring[]AvailabilityZonesoptional*[]*string#backupRetentionPeriodoptionalnumberbackup_retention_periodoptionalint | floatbackupRetentionPeriodoptionalNumberBackupRetentionPeriodoptionaldoubleBackupRetentionPeriodoptional*float64#Default: 1
Constraints:
- Must be a value from 1 to 35.
copyTagsToSnapshotoptionalboolean | IResolvablecopy_tags_to_snapshotoptionaltyping.Union[bool, IResolvable]copyTagsToSnapshotoptionalBooleanCopyTagsToSnapshotoptionalboolCopyTagsToSnapshotoptionalinterface{}#The default is false .
dbClusterIdentifieroptionalstringdb_cluster_identifieroptionalstrdbClusterIdentifieroptionalStringDbClusterIdentifieroptionalstringDbClusterIdentifieroptional*string#Constraints:
- Must contain from 1 to 63 letters, numbers, or hyphens.
- The first character must be a letter.
- Cannot end with a hyphen or contain two consecutive hyphens.
Example: my-cluster
dbClusterParameterGroupNameoptionalstringdb_cluster_parameter_group_nameoptionalstrdbClusterParameterGroupNameoptionalStringDbClusterParameterGroupNameoptionalstringDbClusterParameterGroupNameoptional*string#dbSubnetGroupNameoptionalstringdb_subnet_group_nameoptionalstrdbSubnetGroupNameoptionalStringDbSubnetGroupNameoptionalstringDbSubnetGroupNameoptional*string#Constraints: Must match the name of an existing DBSubnetGroup . Must not be default.
Example: mySubnetgroup
deletionProtectionoptionalboolean | IResolvabledeletion_protectionoptionaltyping.Union[bool, IResolvable]deletionProtectionoptionalBooleanDeletionProtectionoptionalboolDeletionProtectionoptionalinterface{}#If enabled, the cluster cannot be deleted unless it is modified and DeletionProtection is disabled.
enableCloudwatchLogsExportsoptionalstring[]enable_cloudwatch_logs_exportsoptionaltyping.List[str]enableCloudwatchLogsExportsoptionalList<String>EnableCloudwatchLogsExportsoptionalstring[]EnableCloudwatchLogsExportsoptional*[]*string#notes
You can enable audit logs or profiler logs. For more information, see Auditing Amazon DocumentDB Events and Profiling Amazon DocumentDB Operations .
engineVersionoptionalstringengine_versionoptionalstrengineVersionoptionalStringEngineVersionoptionalstringEngineVersionoptional*string#notes
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.
If you intend to trigger an in-place upgrade, please refer to Amazon DocumentDB in-place major version upgrade . Note that for an in-place engine version upgrade, you need to remove other cluster properties changes (e.g. SecurityGroupId) from the CFN template.
globalClusterIdentifieroptionalstringglobal_cluster_identifieroptionalstrglobalClusterIdentifieroptionalStringGlobalClusterIdentifieroptionalstringGlobalClusterIdentifieroptional*string#kmsKeyIdoptionalstringkms_key_idoptionalstrkmsKeyIdoptionalStringKmsKeyIdoptionalstringKmsKeyIdoptional*string#notes
The AWS key identifier is the Amazon Resource Name (ARN) for the AWS encryption key. If you are creating a cluster using the same AWS account that owns the AWS encryption key that is used to encrypt the new cluster, you can use the AWS key alias instead of the ARN for the AWS encryption key.
If an encryption key is not specified in KmsKeyId :
- If the
StorageEncryptedparameter istrue, Amazon DocumentDB uses your default encryption key.
AWS creates the default encryption key for your AWS account . Your AWS account has a different default encryption key for each AWS Regions .
manageMasterUserPasswordoptionalboolean | IResolvablemanage_master_user_passwordoptionaltyping.Union[bool, IResolvable]manageMasterUserPasswordoptionalBooleanManageMasterUserPasswordoptionalboolManageMasterUserPasswordoptionalinterface{}#Constraint: You can't manage the master user password with Amazon Web Services Secrets Manager if MasterUserPassword is specified.
masterUsernameoptionalstringmaster_usernameoptionalstrmasterUsernameoptionalStringMasterUsernameoptionalstringMasterUsernameoptional*string#Constraints:
- Must be from 1 to 63 letters or numbers.
- The first character must be a letter.
- Cannot be a reserved word for the chosen database engine.
masterUserPasswordoptionalstringmaster_user_passwordoptionalstrmasterUserPasswordoptionalStringMasterUserPasswordoptionalstringMasterUserPasswordoptional*string#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.
masterUserSecretKmsKeyIdoptionalstringmaster_user_secret_kms_key_idoptionalstrmasterUserSecretKmsKeyIdoptionalStringMasterUserSecretKmsKeyIdoptionalstringMasterUserSecretKmsKeyIdoptional*string#notes
This setting is valid only if the master user password is managed by Amazon DocumentDB in Amazon Web Services Secrets Manager for the DB cluster.
The Amazon Web Services KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. To use a KMS key in a different Amazon Web Services account, specify the key ARN or alias ARN.
If you don't specify MasterUserSecretKmsKeyId , then the aws/secretsmanager KMS key is used to encrypt the secret. If the secret is in a different Amazon Web Services account, then you can't use the aws/secretsmanager KMS key to encrypt the secret, and you must use a customer managed KMS key.
There is a default KMS key for your Amazon Web Services account. Your Amazon Web Services account has a different default KMS key for each Amazon Web Services Region.
networkTypeoptionalstringnetwork_typeoptionalstrnetworkTypeoptionalStringNetworkTypeoptionalstringNetworkTypeoptional*string#notes
The network type is determined by the DBSubnetGroup specified for the cluster. A DBSubnetGroup can support only the IPv4 protocol or the IPv4 and the IPv6 protocols ( DUAL ).
For more information, see DocumentDB clusters in a VPC in the Amazon DocumentDB Developer Guide.
Valid Values: IPV4 | DUAL
preferredBackupWindowoptionalstringpreferred_backup_windowoptionalstrpreferredBackupWindowoptionalStringPreferredBackupWindowoptionalstringPreferredBackupWindowoptional*string#notes
The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region .
Constraints:
- Must be in the format
hh24:mi-hh24:mi. - Must be in Universal Coordinated Time (UTC).
- Must not conflict with the preferred maintenance window.
- Must be at least 30 minutes.
preferredMaintenanceWindowoptionalstringpreferred_maintenance_windowoptionalstrpreferredMaintenanceWindowoptionalStringPreferredMaintenanceWindowoptionalstringPreferredMaintenanceWindowoptional*string#notes
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.
restoreToTimeoptionalstringrestore_to_timeoptionalstrrestoreToTimeoptionalStringRestoreToTimeoptionalstringRestoreToTimeoptional*string#notes
Valid values: A time in Universal Coordinated Time (UTC) format.
Constraints:
- Must be before the latest restorable time for the instance.
- Must be specified if the
UseLatestRestorableTimeparameter is not provided. - Cannot be specified if the
UseLatestRestorableTimeparameter istrue. - Cannot be specified if the
RestoreTypeparameter iscopy-on-write.
Example: 2015-03-07T23:45:00Z
restoreTypeoptionalstringrestore_typeoptionalstrrestoreTypeoptionalStringRestoreTypeoptionalstringRestoreTypeoptional*string#notes
full-copy- The new DB cluster is restored as a full copy of the source DB cluster.copy-on-write- The new DB cluster is restored as a clone of the source DB cluster.
Constraints: You can't specify copy-on-write if the engine version of the source DB cluster is earlier than 1.11.
If you don't specify a RestoreType value, then the new DB cluster is restored as a full copy of the source DB cluster.
rotateMasterUserPasswordoptionalboolean | IResolvablerotate_master_user_passwordoptionaltyping.Union[bool, IResolvable]rotateMasterUserPasswordoptionalBooleanRotateMasterUserPasswordoptionalboolRotateMasterUserPasswordoptionalinterface{}#notes
This setting is valid only if the master user password is managed by Amazon DocumentDB in Amazon Web Services Secrets Manager for the cluster. The secret value contains the updated password.
Constraint: You must apply the change immediately when rotating the master user password.
serverlessV2ScalingConfigurationoptionalIResolvable | CfnDBCluster.ServerlessV2ScalingConfigurationPropertyserverless_v2_scaling_configurationoptionaltyping.Union[IResolvable, ServerlessV2ScalingConfigurationProperty]serverlessV2ScalingConfigurationoptionalIResolvableServerlessV2ScalingConfigurationoptionalIResolvableServerlessV2ScalingConfigurationoptionalinterface{}#snapshotIdentifieroptionalstringsnapshot_identifieroptionalstrsnapshotIdentifieroptionalStringSnapshotIdentifieroptionalstringSnapshotIdentifieroptional*string#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:
- Must match the identifier of an existing snapshot.
sourceDbClusterIdentifieroptionalstringsource_db_cluster_identifieroptionalstrsourceDbClusterIdentifieroptionalStringSourceDbClusterIdentifieroptionalstringSourceDbClusterIdentifieroptional*string#Constraints:
- Must match the identifier of an existing
DBCluster.
storageEncryptedoptionalboolean | IResolvablestorage_encryptedoptionaltyping.Union[bool, IResolvable]storageEncryptedoptionalBooleanStorageEncryptedoptionalboolStorageEncryptedoptionalinterface{}#notes
If you specify SourceDBClusterIdentifier or SnapshotIdentifier and don’t specify StorageEncrypted , the encryption property is inherited from the source cluster or snapshot (unless KMSKeyId is specified, in which case the restored cluster will be encrypted with that KMS key). If the source is encrypted and StorageEncrypted is specified to be true, the restored cluster will be encrypted (if you want to use a different KMS key, specify the KMSKeyId property as well). If the source is unencrypted and StorageEncrypted is specified to be true, then the KMSKeyId property must be specified. If the source is encrypted, don’t specify StorageEncrypted to be false as opting out of encryption is not allowed.
storageTypeoptionalstringstorage_typeoptionalstrstorageTypeoptionalStringStorageTypeoptionalstringStorageTypeoptional*string#notes
For information on storage types for Amazon DocumentDB clusters, see Cluster storage configurations in the Amazon DocumentDB Developer Guide .
Valid values for storage type - standard | iopt1
Default value is standard
When you create an Amazon DocumentDB cluster with the storage type set to
iopt1, the storage type is returned in the response. The storage type isn't returned when you set it tostandard.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#useLatestRestorableTimeoptionalboolean | IResolvableuse_latest_restorable_timeoptionaltyping.Union[bool, IResolvable]useLatestRestorableTimeoptionalBooleanUseLatestRestorableTimeoptionalboolUseLatestRestorableTimeoptionalinterface{}#Default: false
Constraints: Cannot be specified if the RestoreToTime parameter is provided.
vpcSecurityGroupIdsoptionalstring[]vpc_security_group_idsoptionaltyping.List[str]vpcSecurityGroupIdsoptionalList<String>VpcSecurityGroupIdsoptionalstring[]VpcSecurityGroupIdsoptional*[]*string#