Skip to main content

db_cluster_snapshots

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

Overview

Namedb_cluster_snapshots
TypeResource
Idaws.docdb.db_cluster_snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
availability_zonesstringProvides the list of Amazon EC2 Availability Zones that instances in the cluster snapshot can be restored in.
cluster_create_timestringSpecifies the time when the cluster was created, in Universal Coordinated Time (UTC).
db_cluster_identifierstringSpecifies the cluster identifier of the cluster that this cluster snapshot was created from.
db_cluster_snapshot_arnstringThe Amazon Resource Name (ARN) for the cluster snapshot.
db_cluster_snapshot_identifierstringSpecifies the identifier for the cluster snapshot.
enginestringSpecifies the name of the database engine.
engine_versionstringProvides the version of the database engine for this cluster snapshot.
kms_key_idstringIf StorageEncrypted is true, the KMS key identifier for the encrypted cluster snapshot.
master_usernamestringProvides the master user name for the cluster snapshot.
percent_progressintegerSpecifies the percentage of the estimated data that has been transferred.
portintegerSpecifies the port that the cluster was listening on at the time of the snapshot.
snapshot_create_timestringProvides the time when the snapshot was taken, in UTC.
snapshot_typestringProvides the type of the cluster snapshot.
source_db_cluster_snapshot_arnstringIf the cluster snapshot was copied from a source cluster snapshot, the ARN for the source cluster snapshot; otherwise, a null value.
statusstringSpecifies the status of this cluster snapshot.
storage_encryptedbooleanSpecifies whether the cluster snapshot is encrypted.
storage_typestringStorage type associated with your cluster snapshot 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_idstringProvides the virtual private cloud (VPC) ID that is associated with the cluster snapshot.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_db_cluster_snapshotsselectregionDBClusterIdentifier, DBClusterSnapshotIdentifier, SnapshotType, Filters, MaxRecords, Marker, IncludeShared, IncludePublicReturns information about cluster snapshots. This API operation supports pagination.
create_db_cluster_snapshotinsertDBClusterSnapshotIdentifier, DBClusterIdentifier, regionTagsCreates a snapshot of a cluster.
delete_db_cluster_snapshotdeleteDBClusterSnapshotIdentifier, regionDeletes a cluster snapshot. If the snapshot is being copied, the copy operation is terminated. The cluster snapshot must be in the available state to be deleted.

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 create a snapshot for. This parameter is not case sensitive. Constraints: Must match the identifier of an existing DBCluster. Example: my-cluster
DBClusterSnapshotIdentifierstringThe identifier of the cluster snapshot to delete. Constraints: Must be the name of an existing cluster snapshot in the available state.
regionstringAWS region (default: us-east-1)
DBClusterIdentifierstringThe ID of the cluster to retrieve the list of cluster snapshots for. This parameter can't be used with the DBClusterSnapshotIdentifier parameter. This parameter is not case sensitive. Constraints: If provided, must match the identifier of an existing DBCluster.
DBClusterSnapshotIdentifierstringA specific cluster snapshot identifier to describe. This parameter can't be used with the DBClusterIdentifier parameter. This value is stored as a lowercase string. Constraints: If provided, must match the identifier of an existing DBClusterSnapshot. If this identifier is for an automated snapshot, the SnapshotType parameter must also be specified.
FiltersarrayThis parameter is not currently supported.
IncludePublicbooleanSet to true to include manual cluster snapshots that are public and can be copied or restored by any Amazon Web Services account, and otherwise false. The default is false.
IncludeSharedbooleanSet to true to include shared manual cluster snapshots from other Amazon Web Services accounts that this Amazon Web Services account has been given permission to copy or restore, and otherwise false. The default is false.
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.
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.
SnapshotTypestringThe type of cluster snapshots to be returned. You can specify one of the following values: automated - Return all cluster snapshots that Amazon DocumentDB has automatically created for your Amazon Web Services account. manual - Return all cluster snapshots that you have manually created for your Amazon Web Services account. shared - Return all manual cluster snapshots that have been shared to your Amazon Web Services account. public - Return all cluster snapshots that have been marked as public. If you don't specify a SnapshotType value, then both automated and manual cluster snapshots are returned. You can include shared cluster snapshots with these results by setting the IncludeShared parameter to true. You can include public cluster snapshots with these results by setting theIncludePublic parameter to true. The IncludeShared and IncludePublic parameters don't apply for SnapshotType values of manual or automated. The IncludePublic parameter doesn't apply when SnapshotType is set to shared. The IncludeShared parameter doesn't apply when SnapshotType is set to public.
TagsarrayThe tags to be assigned to the cluster snapshot.

SELECT examples

Returns information about cluster snapshots. This API operation supports pagination.

SELECT
availability_zones,
cluster_create_time,
db_cluster_identifier,
db_cluster_snapshot_arn,
db_cluster_snapshot_identifier,
engine,
engine_version,
kms_key_id,
master_username,
percent_progress,
port,
snapshot_create_time,
snapshot_type,
source_db_cluster_snapshot_arn,
status,
storage_encrypted,
storage_type,
vpc_id
FROM aws.docdb.db_cluster_snapshots
WHERE region = '{{ region }}' -- required
AND DBClusterIdentifier = '{{ DBClusterIdentifier }}'
AND DBClusterSnapshotIdentifier = '{{ DBClusterSnapshotIdentifier }}'
AND SnapshotType = '{{ SnapshotType }}'
AND Filters = '{{ Filters }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
AND IncludeShared = '{{ IncludeShared }}'
AND IncludePublic = '{{ IncludePublic }}'
;

INSERT examples

Creates a snapshot of a cluster.

INSERT INTO aws.docdb.db_cluster_snapshots (
DBClusterSnapshotIdentifier,
DBClusterIdentifier,
region,
Tags
)
SELECT
'{{ DBClusterSnapshotIdentifier }}',
'{{ DBClusterIdentifier }}',
'{{ region }}',
'{{ Tags }}'
RETURNING
availability_zones,
cluster_create_time,
db_cluster_identifier,
db_cluster_snapshot_arn,
db_cluster_snapshot_identifier,
engine,
engine_version,
kms_key_id,
master_username,
percent_progress,
port,
snapshot_create_time,
snapshot_type,
source_db_cluster_snapshot_arn,
status,
storage_encrypted,
storage_type,
vpc_id
;

DELETE examples

Deletes a cluster snapshot. If the snapshot is being copied, the copy operation is terminated. The cluster snapshot must be in the available state to be deleted.

DELETE FROM aws.docdb.db_cluster_snapshots
WHERE DBClusterSnapshotIdentifier = '{{ DBClusterSnapshotIdentifier }}' --required
AND region = '{{ region }}' --required
;