db_cluster_snapshots
Creates, updates, deletes, gets or lists a db_cluster_snapshots resource.
Overview
| Name | db_cluster_snapshots |
| Type | Resource |
| Id | aws.docdb.db_cluster_snapshots |
Fields
The following fields are returned by SELECT queries:
- describe_db_cluster_snapshots
| Name | Datatype | Description |
|---|---|---|
availability_zones | string | Provides the list of Amazon EC2 Availability Zones that instances in the cluster snapshot can be restored in. |
cluster_create_time | string | Specifies the time when the cluster was created, in Universal Coordinated Time (UTC). |
db_cluster_identifier | string | Specifies the cluster identifier of the cluster that this cluster snapshot was created from. |
db_cluster_snapshot_arn | string | The Amazon Resource Name (ARN) for the cluster snapshot. |
db_cluster_snapshot_identifier | string | Specifies the identifier for the cluster snapshot. |
engine | string | Specifies the name of the database engine. |
engine_version | string | Provides the version of the database engine for this cluster snapshot. |
kms_key_id | string | If StorageEncrypted is true, the KMS key identifier for the encrypted cluster snapshot. |
master_username | string | Provides the master user name for the cluster snapshot. |
percent_progress | integer | Specifies the percentage of the estimated data that has been transferred. |
port | integer | Specifies the port that the cluster was listening on at the time of the snapshot. |
snapshot_create_time | string | Provides the time when the snapshot was taken, in UTC. |
snapshot_type | string | Provides the type of the cluster snapshot. |
source_db_cluster_snapshot_arn | string | If the cluster snapshot was copied from a source cluster snapshot, the ARN for the source cluster snapshot; otherwise, a null value. |
status | string | Specifies the status of this cluster snapshot. |
storage_encrypted | boolean | Specifies whether the cluster snapshot is encrypted. |
storage_type | string | Storage 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_id | string | Provides the virtual private cloud (VPC) ID that is associated with the cluster snapshot. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_db_cluster_snapshots | select | region | DBClusterIdentifier, DBClusterSnapshotIdentifier, SnapshotType, Filters, MaxRecords, Marker, IncludeShared, IncludePublic | Returns information about cluster snapshots. This API operation supports pagination. |
create_db_cluster_snapshot | insert | DBClusterSnapshotIdentifier, DBClusterIdentifier, region | Tags | Creates a snapshot of a cluster. |
delete_db_cluster_snapshot | delete | DBClusterSnapshotIdentifier, region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
DBClusterIdentifier | string | The 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 |
DBClusterSnapshotIdentifier | string | The identifier of the cluster snapshot to delete. Constraints: Must be the name of an existing cluster snapshot in the available state. |
region | string | AWS region (default: us-east-1) |
DBClusterIdentifier | string | The 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. |
DBClusterSnapshotIdentifier | string | A 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. |
Filters | array | This parameter is not currently supported. |
IncludePublic | boolean | Set 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. |
IncludeShared | boolean | Set 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. |
Marker | string | An 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. |
MaxRecords | integer | The 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. |
SnapshotType | string | The 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. |
Tags | array | The tags to be assigned to the cluster snapshot. |
SELECT examples
- describe_db_cluster_snapshots
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
- create_db_cluster_snapshot
- Manifest
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
;
# Description fields are for documentation purposes
- name: db_cluster_snapshots
props:
- name: DBClusterSnapshotIdentifier
value: "{{ DBClusterSnapshotIdentifier }}"
description: Required parameter for the db_cluster_snapshots resource.
- name: DBClusterIdentifier
value: "{{ DBClusterIdentifier }}"
description: Required parameter for the db_cluster_snapshots resource.
- name: region
value: "{{ region }}"
description: Required parameter for the db_cluster_snapshots resource.
- name: Tags
value: "{{ Tags }}"
description: The tags to be assigned to the cluster snapshot.
description: The tags to be assigned to the cluster snapshot.
DELETE examples
- delete_db_cluster_snapshot
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
;