Skip to main content

db_clusters

Creates, updates, deletes, gets or lists a db_clusters resource.

Overview

Namedb_clusters
TypeResource
Idaws.docdb.db_clusters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
associated_rolesstringProvides a list of the Identity and Access Management (IAM) roles that are associated with the cluster. (IAM) roles that are associated with a cluster grant permission for the cluster to access other Amazon Web Services services on your behalf.
availability_zonesstringProvides the list of Amazon EC2 Availability Zones that instances in the cluster can be created in.
backup_retention_periodintegerSpecifies the number of days for which automatic snapshots are retained.
clone_group_idstringIdentifies the clone group to which the DB cluster is associated.
cluster_create_timestringSpecifies the time when the cluster was created, in Universal Coordinated Time (UTC).
db_cluster_arnstringThe Amazon Resource Name (ARN) for the cluster.
db_cluster_identifierstringContains a user-supplied cluster identifier. This identifier is the unique key that identifies a cluster.
db_cluster_membersstringProvides the list of instances that make up the cluster.
db_cluster_parameter_groupstringSpecifies the name of the cluster parameter group for the cluster.
db_subnet_groupstringSpecifies information on the subnet group that is associated with the cluster, including the name, description, and subnets in the subnet group.
db_cluster_resource_idstringThe Amazon Web Services Region-unique, immutable identifier for the cluster. This identifier is found in CloudTrail log entries whenever the KMS key for the cluster is accessed.
deletion_protectionbooleanSpecifies whether this cluster can be deleted. If DeletionProtection is enabled, the cluster cannot be deleted unless it is modified and DeletionProtection is disabled. DeletionProtection protects clusters from being accidentally deleted.
earliest_restorable_timestringThe earliest time to which a database can be restored with point-in-time restore.
enabled_cloudwatch_logs_exportsstringA list of log types that this cluster is configured to export to Amazon CloudWatch Logs.
endpointstringSpecifies the connection endpoint for the primary instance of the cluster.
enginestringProvides the name of the database engine to be used for this cluster.
engine_versionstringIndicates the database engine version.
hosted_zone_idstringSpecifies the ID that Amazon Route 53 assigns when you create a hosted zone.
io_optimized_next_allowed_modification_timestringThe next time you can modify the Amazon DocumentDB cluster to use the iopt1 storage type.
kms_key_idstringIf StorageEncrypted is true, the KMS key identifier for the encrypted cluster.
latest_restorable_timestringSpecifies the latest time to which a database can be restored with point-in-time restore.
master_user_secretstringThe secret managed by Amazon DocumentDB in Amazon Web Services Secrets Manager for the master user password.
master_usernamestringContains the master user name for the cluster.
multi_azbooleanSpecifies whether the cluster has instances in multiple Availability Zones.
network_typestringThe network type of the cluster. 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
percent_progressstringSpecifies the progress of the operation as a percentage.
portintegerSpecifies the port that the database engine is listening on.
preferred_backup_windowstringSpecifies the daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.
preferred_maintenance_windowstringSpecifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
read_replica_identifiersstringContains one or more identifiers of the secondary clusters that are associated with this cluster.
reader_endpointstringThe reader endpoint for the cluster. The reader endpoint for a cluster load balances connections across the Amazon DocumentDB replicas that are available in a cluster. As clients request new connections to the reader endpoint, Amazon DocumentDB distributes the connection requests among the Amazon DocumentDB replicas in the cluster. This functionality can help balance your read workload across multiple Amazon DocumentDB replicas in your cluster. If a failover occurs, and the Amazon DocumentDB replica that you are connected to is promoted to be the primary instance, your connection is dropped. To continue sending your read workload to other Amazon DocumentDB replicas in the cluster, you can then reconnect to the reader endpoint.
replication_source_identifierstringContains the identifier of the source cluster if this cluster is a secondary cluster.
serverless_v2_scaling_configurationstringThe scaling configuration of an Amazon DocumentDB Serverless cluster.
statusstringSpecifies the current state of this cluster.
storage_encryptedbooleanSpecifies whether the cluster is encrypted.
storage_typestringStorage type associated with your cluster 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
vpc_security_groupsstringProvides a list of virtual private cloud (VPC) security groups that the cluster belongs to.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_db_clustersselectregionDBClusterIdentifier, Filters, MaxRecords, MarkerReturns information about provisioned Amazon DocumentDB clusters. This API operation supports pagination. For certain management features such as cluster and instance lifecycle management, Amazon DocumentDB leverages operational technology that is shared with Amazon RDS and Amazon Neptune. Use the filterName=engine,Values=docdb filter parameter to return only Amazon DocumentDB clusters.
create_db_clusterinsertDBClusterIdentifier, regionAvailabilityZones, BackupRetentionPeriod, DBClusterParameterGroupName, VpcSecurityGroupIds, DBSubnetGroupName, Engine, EngineVersion, Port, MasterUsername, MasterUserPassword, PreferredBackupWindow, PreferredMaintenanceWindow, Tags, StorageEncrypted, KmsKeyId, PreSignedUrl, EnableCloudwatchLogsExports, DeletionProtection, GlobalClusterIdentifier, StorageType, ServerlessV2ScalingConfiguration, ManageMasterUserPassword, MasterUserSecretKmsKeyId, NetworkTypeCreates a new Amazon DocumentDB cluster.
modify_db_clusterupdateDBClusterIdentifier, regionNewDBClusterIdentifier, ApplyImmediately, BackupRetentionPeriod, DBClusterParameterGroupName, VpcSecurityGroupIds, Port, MasterUserPassword, PreferredBackupWindow, PreferredMaintenanceWindow, CloudwatchLogsExportConfiguration, EngineVersion, AllowMajorVersionUpgrade, DeletionProtection, StorageType, ServerlessV2ScalingConfiguration, ManageMasterUserPassword, MasterUserSecretKmsKeyId, RotateMasterUserPassword, NetworkTypeModifies a setting for an Amazon DocumentDB cluster. You can change one or more database configuration parameters by specifying these parameters and the new values in the request.
delete_db_clusterdeleteDBClusterIdentifier, regionSkipFinalSnapshot, FinalDBSnapshotIdentifierDeletes a previously provisioned cluster. When you delete a cluster, all automated backups for that cluster are deleted and can't be recovered. Manual DB cluster snapshots of the specified cluster are not deleted.
copy_db_cluster_snapshotexecSourceDBClusterSnapshotIdentifier, TargetDBClusterSnapshotIdentifier, regionKmsKeyId, PreSignedUrl, CopyTags, TagsCopies a snapshot of a cluster. To copy a cluster snapshot from a shared manual cluster snapshot, SourceDBClusterSnapshotIdentifier must be the Amazon Resource Name (ARN) of the shared cluster snapshot. You can only copy a shared DB cluster snapshot, whether encrypted or not, in the same Amazon Web Services Region. To cancel the copy operation after it is in progress, delete the target cluster snapshot identified by TargetDBClusterSnapshotIdentifier while that cluster snapshot is in the copying status.
restore_db_cluster_from_snapshotexecDBClusterIdentifier, SnapshotIdentifier, regionAvailabilityZones, Engine, EngineVersion, Port, DBSubnetGroupName, VpcSecurityGroupIds, Tags, KmsKeyId, EnableCloudwatchLogsExports, DeletionProtection, DBClusterParameterGroupName, ServerlessV2ScalingConfiguration, StorageType, NetworkTypeCreates a new cluster from a snapshot or cluster snapshot. If a snapshot is specified, the target cluster is created from the source DB snapshot with a default configuration and default security group. If a cluster snapshot is specified, the target cluster is created from the source cluster restore point with the same configuration as the original source DB cluster, except that the new cluster is created with the default security group.
restore_db_cluster_to_point_in_timeexecDBClusterIdentifier, SourceDBClusterIdentifier, regionRestoreType, RestoreToTime, UseLatestRestorableTime, Port, DBSubnetGroupName, VpcSecurityGroupIds, Tags, KmsKeyId, EnableCloudwatchLogsExports, DeletionProtection, ServerlessV2ScalingConfiguration, StorageType, NetworkTypeRestores a cluster to an arbitrary point in time. Users can restore to any point in time before LatestRestorableTime for up to BackupRetentionPeriod days. The target cluster is created from the source cluster with the same configuration as the original cluster, except that the new cluster is created with the default security group.
start_db_clusterexecDBClusterIdentifier, regionRestarts the stopped cluster that is specified by DBClusterIdentifier. For more information, see Stopping and Starting an Amazon DocumentDB Cluster.
stop_db_clusterexecDBClusterIdentifier, regionStops the running cluster that is specified by DBClusterIdentifier. The cluster must be in the available state. For more information, see Stopping and Starting an Amazon DocumentDB Cluster.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
DBClusterIdentifierstringThe identifier of the cluster to stop. Example: docdb-2019-05-28-15-24-52
SnapshotIdentifierstringThe identifier for the snapshot or cluster snapshot to restore from. 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.
SourceDBClusterIdentifierstringThe identifier of the source cluster from which to restore. Constraints: Must match the identifier of an existing DBCluster.
SourceDBClusterSnapshotIdentifierstringThe identifier of the cluster snapshot to copy. This parameter is not case sensitive. Constraints: Must specify a valid cluster snapshot in the available state. If the source cluster snapshot is in the same Amazon Web Services Region as the copy, specify a valid snapshot identifier. If the source cluster snapshot is in a different Amazon Web Services Region or owned by another Amazon Web Services account, specify the snapshot ARN. Example: my-cluster-snapshot1
TargetDBClusterSnapshotIdentifierstringThe identifier of the new cluster snapshot to create from the source cluster snapshot. This parameter is not case sensitive. 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-snapshot2
regionstringAWS region (default: us-east-1)
AllowMajorVersionUpgradebooleanA value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the cluster's current version. Since some parameters are version specific, changing them requires executing a new ModifyDBCluster API call after the in-place MVU completes. Performing an MVU directly impacts the following parameters: MasterUserPassword NewDBClusterIdentifier VpcSecurityGroupIds Port
ApplyImmediatelybooleanA value that specifies whether the changes in this request and any pending changes are asynchronously applied as soon as possible, regardless of the PreferredMaintenanceWindow setting for the cluster. If this parameter is set to false, changes to the cluster are applied during the next maintenance window. The ApplyImmediately parameter affects only the NewDBClusterIdentifier and MasterUserPassword values. If you set this parameter value to false, the changes to the NewDBClusterIdentifier and MasterUserPassword values are applied during the next maintenance window. All other changes are applied immediately, regardless of the value of the ApplyImmediately parameter. Default: false
AvailabilityZonesarrayProvides the list of Amazon EC2 Availability Zones that instances in the restored DB cluster can be created in.
BackupRetentionPeriodintegerThe number of days for which automated backups are retained. You must specify a minimum value of 1. Default: 1 Constraints: Must be a value from 1 to 35.
CloudwatchLogsExportConfigurationobjectThe configuration setting for the log types to be enabled for export to Amazon CloudWatch Logs for a specific instance or cluster. The EnableLogTypes and DisableLogTypes arrays determine which logs are exported (or not exported) to CloudWatch Logs.
CopyTagsbooleanSet to true to copy all tags from the source cluster snapshot to the target cluster snapshot, and otherwise false. The default is false.
DBClusterIdentifierstringThe user-provided cluster identifier. If this parameter is specified, information from only the specific cluster is returned. This parameter isn't case sensitive. Constraints: If provided, must match an existing DBClusterIdentifier.
DBClusterParameterGroupNamestringThe name of the DB cluster parameter group to associate with this DB cluster. Type: String. Required: No. If this argument is omitted, the default DB cluster parameter group is used. If supplied, must match the name of an existing default DB cluster parameter group. The string must consist of from 1 to 255 letters, numbers or hyphens. Its first character must be a letter, and it cannot end with a hyphen or contain two consecutive hyphens.
DBSubnetGroupNamestringThe subnet group name to use for the new cluster. Constraints: If provided, must match the name of an existing DBSubnetGroup. Example: mySubnetgroup
DeletionProtectionbooleanSpecifies whether this cluster can be deleted. If DeletionProtection is enabled, the cluster cannot be deleted unless it is modified and DeletionProtection is disabled. DeletionProtection protects clusters from being accidentally deleted.
EnableCloudwatchLogsExportsarrayA list of log types that must be enabled for exporting to Amazon CloudWatch Logs.
EnginestringThe database engine to use for the new cluster. Default: The same as source. Constraint: Must be compatible with the engine of the source.
EngineVersionstringThe version of the database engine to use for the new cluster.
FiltersarrayA filter that specifies one or more clusters to describe. Supported filters: db-cluster-id - Accepts cluster identifiers and cluster Amazon Resource Names (ARNs). The results list only includes information about the clusters identified by these ARNs.
FinalDBSnapshotIdentifierstringThe cluster snapshot identifier of the new cluster snapshot created when SkipFinalSnapshot is set to false. Specifying this parameter and also setting the SkipFinalShapshot parameter to true results in an error. Constraints: Must be from 1 to 255 letters, numbers, or hyphens. The first character must be a letter. Cannot end with a hyphen or contain two consecutive hyphens.
GlobalClusterIdentifierstringThe cluster identifier of the new global cluster.
KmsKeyIdstringThe KMS key identifier to use when restoring an encrypted cluster from an encrypted cluster. The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are restoring a cluster with the same Amazon Web Services account that owns the KMS encryption key used to encrypt the new cluster, then you can use the KMS key alias instead of the ARN for the KMS encryption key. You can restore to a new cluster and encrypt the new cluster with an KMS key that is different from the KMS key used to encrypt the source cluster. The new DB cluster is encrypted with the KMS key identified by the KmsKeyId parameter. If you do not specify a value for the KmsKeyId parameter, then the following occurs: If the cluster is encrypted, then the restored cluster is encrypted using the KMS key that was used to encrypt the source cluster. If the cluster is not encrypted, then the restored cluster is not encrypted. If DBClusterIdentifier refers to a cluster that is not encrypted, then the restore request is rejected.
ManageMasterUserPasswordbooleanSpecifies whether to manage the master user password with Amazon Web Services Secrets Manager. If the cluster doesn't manage the master user password with Amazon Web Services Secrets Manager, you can turn on this management. In this case, you can't specify MasterUserPassword. If the cluster already manages the master user password with Amazon Web Services Secrets Manager, and you specify that the master user password is not managed with Amazon Web Services Secrets Manager, then you must specify MasterUserPassword. In this case, Amazon DocumentDB deletes the secret and uses the new password for the master user specified by MasterUserPassword.
MarkerstringAn optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by MaxRecords.
MasterUserPasswordstringThe password for the master database user. 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.
MasterUserSecretKmsKeyIdstringThe Amazon Web Services KMS key identifier to encrypt a secret that is automatically generated and managed in Amazon Web Services Secrets Manager. This setting is valid only if both of the following conditions are met: The cluster doesn't manage the master user password in Amazon Web Services Secrets Manager. If the cluster already manages the master user password in Amazon Web Services Secrets Manager, you can't change the KMS key that is used to encrypt the secret. You are enabling ManageMasterUserPassword to manage the master user password in Amazon Web Services Secrets Manager. If you are turning on ManageMasterUserPassword and 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. 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. 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.
MasterUsernamestringThe name of the master user for the cluster. 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.
MaxRecordsintegerThe maximum number of records to include in the response. If more records exist than the specified MaxRecords value, a pagination token (marker) is included in the response so that the remaining results can be retrieved. Default: 100 Constraints: Minimum 20, maximum 100.
NetworkTypestringThe network type of the cluster. 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
NewDBClusterIdentifierstringThe new cluster identifier for the cluster when renaming a cluster. This value is stored as a lowercase 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-cluster2
PortintegerThe port number on which the new cluster accepts connections. Constraints: Must be a value from 1150 to 65535. Default: The default port for the engine.
PreSignedUrlstringThe URL that contains a Signature Version 4 signed request for theCopyDBClusterSnapshot API action in the Amazon Web Services Region that contains the source cluster snapshot to copy. You must use the PreSignedUrl parameter when copying a cluster snapshot from another Amazon Web Services Region. If you are using an Amazon Web Services SDK tool or the CLI, you can specify SourceRegion (or --source-region for the CLI) instead of specifying PreSignedUrl manually. Specifying SourceRegion autogenerates a pre-signed URL that is a valid request for the operation that can be executed in the source Amazon Web Services Region. The presigned URL must be a valid request for the CopyDBClusterSnapshot API action that can be executed in the source Amazon Web Services Region that contains the cluster snapshot to be copied. The presigned URL request must contain the following parameter values: SourceRegion - The ID of the region that contains the snapshot to be copied. SourceDBClusterSnapshotIdentifier - The identifier for the the encrypted cluster snapshot to be copied. This identifier must be in the Amazon Resource Name (ARN) format for the source Amazon Web Services Region. For example, if you are copying an encrypted cluster snapshot from the us-east-1 Amazon Web Services Region, then your SourceDBClusterSnapshotIdentifier looks something like the following: arn:aws:rds:us-east-1:12345678012:sample-cluster:sample-cluster-snapshot. TargetDBClusterSnapshotIdentifier - The identifier for the new cluster snapshot to be created. This parameter isn't case sensitive.
PreferredBackupWindowstringThe daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter. The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services 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.
PreferredMaintenanceWindowstringThe weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). 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 Amazon Web Services Region, occurring on a random day of the week. Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun Constraints: Minimum 30-minute window.
RestoreToTimestring (date-time)The date and time to restore the cluster to. 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 UseLatestRestorableTime parameter is not provided. Cannot be specified if the UseLatestRestorableTime parameter is true. Cannot be specified if the RestoreType parameter is copy-on-write. Example: 2015-03-07T23:45:00Z
RestoreTypestringThe type of restore to be performed. You can specify one of the following values: 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.
RotateMasterUserPasswordbooleanSpecifies whether to rotate the secret managed by Amazon Web Services Secrets Manager for the master user password. 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.
ServerlessV2ScalingConfigurationobjectContains the scaling configuration of an Amazon DocumentDB Serverless cluster.
SkipFinalSnapshotbooleanDetermines whether a final cluster snapshot is created before the cluster is deleted. If true is specified, no cluster snapshot is created. If false is specified, a cluster snapshot is created before the DB cluster is deleted. If SkipFinalSnapshot is false, you must specify a FinalDBSnapshotIdentifier parameter. Default: false
StorageEncryptedbooleanSpecifies whether the cluster is encrypted.
StorageTypestringThe storage type to associate with the DB cluster. 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
TagsarrayThe tags to be assigned to the restored cluster.
UseLatestRestorableTimebooleanA value that is set to true to restore the cluster to the latest restorable backup time, and false otherwise. Default: false Constraints: Cannot be specified if the RestoreToTime parameter is provided.
VpcSecurityGroupIdsarrayA list of VPC security groups that the new cluster belongs to.

SELECT examples

Returns information about provisioned Amazon DocumentDB clusters. This API operation supports pagination. For certain management features such as cluster and instance lifecycle management, Amazon DocumentDB leverages operational technology that is shared with Amazon RDS and Amazon Neptune. Use the filterName=engine,Values=docdb filter parameter to return only Amazon DocumentDB clusters.

SELECT
associated_roles,
availability_zones,
backup_retention_period,
clone_group_id,
cluster_create_time,
db_cluster_arn,
db_cluster_identifier,
db_cluster_members,
db_cluster_parameter_group,
db_subnet_group,
db_cluster_resource_id,
deletion_protection,
earliest_restorable_time,
enabled_cloudwatch_logs_exports,
endpoint,
engine,
engine_version,
hosted_zone_id,
io_optimized_next_allowed_modification_time,
kms_key_id,
latest_restorable_time,
master_user_secret,
master_username,
multi_az,
network_type,
percent_progress,
port,
preferred_backup_window,
preferred_maintenance_window,
read_replica_identifiers,
reader_endpoint,
replication_source_identifier,
serverless_v2_scaling_configuration,
status,
storage_encrypted,
storage_type,
vpc_security_groups
FROM aws.docdb.db_clusters
WHERE region = '{{ region }}' -- required
AND DBClusterIdentifier = '{{ DBClusterIdentifier }}'
AND Filters = '{{ Filters }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
;

INSERT examples

Creates a new Amazon DocumentDB cluster.

INSERT INTO aws.docdb.db_clusters (
DBClusterIdentifier,
region,
AvailabilityZones,
BackupRetentionPeriod,
DBClusterParameterGroupName,
VpcSecurityGroupIds,
DBSubnetGroupName,
Engine,
EngineVersion,
Port,
MasterUsername,
MasterUserPassword,
PreferredBackupWindow,
PreferredMaintenanceWindow,
Tags,
StorageEncrypted,
KmsKeyId,
PreSignedUrl,
EnableCloudwatchLogsExports,
DeletionProtection,
GlobalClusterIdentifier,
StorageType,
ServerlessV2ScalingConfiguration,
ManageMasterUserPassword,
MasterUserSecretKmsKeyId,
NetworkType
)
SELECT
'{{ DBClusterIdentifier }}',
'{{ region }}',
'{{ AvailabilityZones }}',
'{{ BackupRetentionPeriod }}',
'{{ DBClusterParameterGroupName }}',
'{{ VpcSecurityGroupIds }}',
'{{ DBSubnetGroupName }}',
'{{ Engine }}',
'{{ EngineVersion }}',
'{{ Port }}',
'{{ MasterUsername }}',
'{{ MasterUserPassword }}',
'{{ PreferredBackupWindow }}',
'{{ PreferredMaintenanceWindow }}',
'{{ Tags }}',
'{{ StorageEncrypted }}',
'{{ KmsKeyId }}',
'{{ PreSignedUrl }}',
'{{ EnableCloudwatchLogsExports }}',
'{{ DeletionProtection }}',
'{{ GlobalClusterIdentifier }}',
'{{ StorageType }}',
'{{ ServerlessV2ScalingConfiguration }}',
'{{ ManageMasterUserPassword }}',
'{{ MasterUserSecretKmsKeyId }}',
'{{ NetworkType }}'
RETURNING
associated_roles,
availability_zones,
backup_retention_period,
clone_group_id,
cluster_create_time,
db_cluster_arn,
db_cluster_identifier,
db_cluster_members,
db_cluster_parameter_group,
db_subnet_group,
db_cluster_resource_id,
deletion_protection,
earliest_restorable_time,
enabled_cloudwatch_logs_exports,
endpoint,
engine,
engine_version,
hosted_zone_id,
io_optimized_next_allowed_modification_time,
kms_key_id,
latest_restorable_time,
master_user_secret,
master_username,
multi_az,
network_type,
percent_progress,
port,
preferred_backup_window,
preferred_maintenance_window,
read_replica_identifiers,
reader_endpoint,
replication_source_identifier,
serverless_v2_scaling_configuration,
status,
storage_encrypted,
storage_type,
vpc_security_groups
;

UPDATE examples

Modifies a setting for an Amazon DocumentDB cluster. You can change one or more database configuration parameters by specifying these parameters and the new values in the request.

UPDATE aws.docdb.db_clusters
SET
-- No updatable properties
WHERE
DBClusterIdentifier = '{{ DBClusterIdentifier }}' --required
AND region = '{{ region }}' --required
AND NewDBClusterIdentifier = '{{ NewDBClusterIdentifier}}'
AND ApplyImmediately = {{ ApplyImmediately}}
AND BackupRetentionPeriod = '{{ BackupRetentionPeriod}}'
AND DBClusterParameterGroupName = '{{ DBClusterParameterGroupName}}'
AND VpcSecurityGroupIds = '{{ VpcSecurityGroupIds}}'
AND Port = '{{ Port}}'
AND MasterUserPassword = '{{ MasterUserPassword}}'
AND PreferredBackupWindow = '{{ PreferredBackupWindow}}'
AND PreferredMaintenanceWindow = '{{ PreferredMaintenanceWindow}}'
AND CloudwatchLogsExportConfiguration = '{{ CloudwatchLogsExportConfiguration}}'
AND EngineVersion = '{{ EngineVersion}}'
AND AllowMajorVersionUpgrade = {{ AllowMajorVersionUpgrade}}
AND DeletionProtection = {{ DeletionProtection}}
AND StorageType = '{{ StorageType}}'
AND ServerlessV2ScalingConfiguration = '{{ ServerlessV2ScalingConfiguration}}'
AND ManageMasterUserPassword = {{ ManageMasterUserPassword}}
AND MasterUserSecretKmsKeyId = '{{ MasterUserSecretKmsKeyId}}'
AND RotateMasterUserPassword = {{ RotateMasterUserPassword}}
AND NetworkType = '{{ NetworkType}}'
RETURNING
associated_roles,
availability_zones,
backup_retention_period,
clone_group_id,
cluster_create_time,
db_cluster_arn,
db_cluster_identifier,
db_cluster_members,
db_cluster_parameter_group,
db_subnet_group,
db_cluster_resource_id,
deletion_protection,
earliest_restorable_time,
enabled_cloudwatch_logs_exports,
endpoint,
engine,
engine_version,
hosted_zone_id,
io_optimized_next_allowed_modification_time,
kms_key_id,
latest_restorable_time,
master_user_secret,
master_username,
multi_az,
network_type,
percent_progress,
port,
preferred_backup_window,
preferred_maintenance_window,
read_replica_identifiers,
reader_endpoint,
replication_source_identifier,
serverless_v2_scaling_configuration,
status,
storage_encrypted,
storage_type,
vpc_security_groups;

DELETE examples

Deletes a previously provisioned cluster. When you delete a cluster, all automated backups for that cluster are deleted and can't be recovered. Manual DB cluster snapshots of the specified cluster are not deleted.

DELETE FROM aws.docdb.db_clusters
WHERE DBClusterIdentifier = '{{ DBClusterIdentifier }}' --required
AND region = '{{ region }}' --required
AND SkipFinalSnapshot = '{{ SkipFinalSnapshot }}'
AND FinalDBSnapshotIdentifier = '{{ FinalDBSnapshotIdentifier }}'
;

Lifecycle Methods

Copies a snapshot of a cluster. To copy a cluster snapshot from a shared manual cluster snapshot, SourceDBClusterSnapshotIdentifier must be the Amazon Resource Name (ARN) of the shared cluster snapshot. You can only copy a shared DB cluster snapshot, whether encrypted or not, in the same Amazon Web Services Region. To cancel the copy operation after it is in progress, delete the target cluster snapshot identified by TargetDBClusterSnapshotIdentifier while that cluster snapshot is in the copying status.

EXEC aws.docdb.db_clusters.copy_db_cluster_snapshot
@SourceDBClusterSnapshotIdentifier='{{ SourceDBClusterSnapshotIdentifier }}' --required,
@TargetDBClusterSnapshotIdentifier='{{ TargetDBClusterSnapshotIdentifier }}' --required,
@region='{{ region }}' --required,
@KmsKeyId='{{ KmsKeyId }}',
@PreSignedUrl='{{ PreSignedUrl }}',
@CopyTags={{ CopyTags }},
@Tags='{{ Tags }}'
;