cluster_snapshots
Creates, updates, deletes, gets or lists a cluster_snapshots resource.
Overview
| Name | cluster_snapshots |
| Type | Resource |
| Id | aws.redshift.cluster_snapshots |
Fields
The following fields are returned by SELECT queries:
- describe_cluster_snapshots
| Name | Datatype | Description |
|---|---|---|
accounts_with_restore_access | string | A list of the Amazon Web Services accounts authorized to restore the snapshot. Returns null if no accounts are authorized. Visible only to the snapshot owner. |
actual_incremental_backup_size_in_mega_bytes | number | The size of the incremental backup. |
availability_zone | string | The Availability Zone in which the cluster was created. |
backup_progress_in_mega_bytes | number | The number of megabytes that have been transferred to the snapshot backup. |
cluster_create_time | string | The time (UTC) when the cluster was originally created. |
cluster_identifier | string | The identifier of the cluster for which the snapshot was taken. |
cluster_version | string | The version ID of the Amazon Redshift engine that is running on the cluster. |
current_backup_rate_in_mega_bytes_per_second | number | The number of megabytes per second being transferred to the snapshot backup. Returns 0 for a completed backup. |
db_name | string | The name of the database that was created when the cluster was created. |
elapsed_time_in_seconds | integer | The amount of time an in-progress snapshot backup has been running, or the amount of time it took a completed backup to finish. |
encrypted | boolean | If true, the data in the snapshot is encrypted at rest. |
encrypted_with_hsm | boolean | A boolean that indicates whether the snapshot data is encrypted using the HSM keys of the source cluster. true indicates that the data is encrypted using HSM keys. |
engine_full_version | string | The cluster version of the cluster used to create the snapshot. For example, 1.0.15503. |
enhanced_vpc_routing | boolean | An option that specifies whether to create the cluster with enhanced VPC routing enabled. To create a cluster that uses enhanced VPC routing, the cluster must be in a VPC. For more information, see Enhanced VPC Routing in the Amazon Redshift Cluster Management Guide. If this option is true, enhanced VPC routing is enabled. Default: false |
estimated_seconds_to_completion | integer | The estimate of the time remaining before the snapshot backup will complete. Returns 0 for a completed backup. |
kms_key_id | string | The Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the cluster from which the snapshot was taken. |
maintenance_track_name | string | The name of the maintenance track for the snapshot. |
manual_snapshot_remaining_days | integer | The number of days until a manual snapshot will pass its retention period. |
manual_snapshot_retention_period | integer | The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely. The value must be either -1 or an integer between 1 and 3,653. |
master_password_secret_arn | string | The Amazon Resource Name (ARN) for the cluster's admin user credentials secret. |
master_password_secret_kms_key_id | string | The ID of the Key Management Service (KMS) key used to encrypt and store the cluster's admin credentials secret. |
master_username | string | The admin user name for the cluster. |
node_type | string | The node type of the nodes in the cluster. |
number_of_nodes | integer | The number of nodes in the cluster. |
owner_account | string | For manual snapshots, the Amazon Web Services account used to create or copy the snapshot. For automatic snapshots, the owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual snapshot. |
port | integer | The port that the cluster is listening on. |
restorable_node_types | string | The list of node types that this cluster snapshot is able to restore into. |
snapshot_arn | string | The Amazon Resource Name (ARN) of the snapshot. |
snapshot_create_time | string | The time (in UTC format) when Amazon Redshift began the snapshot. A snapshot contains a copy of the cluster data as of this exact time. |
snapshot_identifier | string | The snapshot identifier that is provided in the request. |
snapshot_retention_start_time | string | A timestamp representing the start of the retention period for the snapshot. |
snapshot_type | string | The snapshot type. Snapshots created using CreateClusterSnapshot and CopyClusterSnapshot are of type "manual". |
source_region | string | The source region from which the snapshot was copied. |
status | string | The snapshot status. The value of the status depends on the API operation used: CreateClusterSnapshot and CopyClusterSnapshot returns status as "creating". DescribeClusterSnapshots returns status as "creating", "available", "final snapshot", or "failed". DeleteClusterSnapshot returns status as "deleted". |
tags | string | The list of tags for the cluster snapshot. |
total_backup_size_in_mega_bytes | number | The size of the complete set of backup data that would be used to restore the cluster. |
vpc_id | string | The VPC identifier of the cluster if the snapshot is from a cluster in a VPC. Otherwise, this field is not in the output. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_cluster_snapshots | select | region | ClusterIdentifier, SnapshotIdentifier, SnapshotArn, SnapshotType, StartTime, EndTime, MaxRecords, Marker, OwnerAccount, TagKeys, TagValues, ClusterExists, SortingEntities | Returns one or more snapshot objects, which contain metadata about your cluster snapshots. By default, this operation returns information about all snapshots of all clusters that are owned by your Amazon Web Services account. No information is returned for snapshots owned by inactive Amazon Web Services accounts. If you specify both tag keys and tag values in the same request, Amazon Redshift returns all snapshots that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all snapshots that have any combination of those values are returned. Only snapshots that you own are returned in the response; shared snapshots are not returned with the tag key and tag value request parameters. If both tag keys and values are omitted from the request, snapshots are returned regardless of whether they have tag keys or values associated with them. |
create_cluster_snapshot | insert | SnapshotIdentifier, ClusterIdentifier, region | ManualSnapshotRetentionPeriod, Tags | Creates a manual snapshot of the specified cluster. The cluster must be in the available state. For more information about working with snapshots, go to Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide. |
modify_cluster_snapshot | update | SnapshotIdentifier, region | ManualSnapshotRetentionPeriod, Force | Modifies the settings for a snapshot. This exanmple modifies the manual retention period setting for a cluster snapshot. |
delete_cluster_snapshot | delete | SnapshotIdentifier, region | SnapshotClusterIdentifier | Deletes the specified manual snapshot. The snapshot must be in the available state, with no other users authorized to access the snapshot. Unlike automated snapshots, manual snapshots are retained even after you delete your cluster. Amazon Redshift does not delete your manual snapshots. You must delete manual snapshot explicitly to avoid getting charged. If other accounts are authorized to access the snapshot, you must revoke all of the authorizations before you can delete the snapshot. |
batch_delete_cluster_snapshots | exec | Identifiers, region | Deletes a set of cluster snapshots. | |
batch_modify_cluster_snapshots | exec | SnapshotIdentifierList, region | ManualSnapshotRetentionPeriod, Force | Modifies the settings for a set of cluster snapshots. |
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 |
|---|---|---|
ClusterIdentifier | string | The cluster identifier for which you want a snapshot. |
Identifiers | array | A list of identifiers for the snapshots that you want to delete. |
SnapshotIdentifier | string | The unique identifier of the manual snapshot to be deleted. Constraints: Must be the name of an existing snapshot that is in the available, failed, or cancelled state. |
SnapshotIdentifierList | array | A list of snapshot identifiers you want to modify. |
region | string | AWS region (default: us-east-1) |
ClusterExists | boolean | A value that indicates whether to return snapshots only for an existing cluster. You can perform table-level restore only by using a snapshot of an existing cluster, that is, a cluster that has not been deleted. Values for this parameter work as follows: If ClusterExists is set to true, ClusterIdentifier is required. If ClusterExists is set to false and ClusterIdentifier isn't specified, all snapshots associated with deleted clusters (orphaned snapshots) are returned. If ClusterExists is set to false and ClusterIdentifier is specified for a deleted cluster, snapshots associated with that cluster are returned. If ClusterExists is set to false and ClusterIdentifier is specified for an existing cluster, no snapshots are returned. |
ClusterIdentifier | string | The identifier of the cluster which generated the requested snapshots. |
EndTime | string (date-time) | A time value that requests only snapshots created at or before the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia page. Example: 2012-07-16T18:00:00Z |
Force | boolean | A boolean value indicating whether to override an exception if the retention period has passed. |
ManualSnapshotRetentionPeriod | integer | The number of days that a manual snapshot is retained. If you specify the value -1, the manual snapshot is retained indefinitely. The number must be either -1 or an integer between 1 and 3,653. If you decrease the manual snapshot retention period from its current value, existing manual snapshots that fall outside of the new retention period will return an error. If you want to suppress the errors and delete the snapshots, use the force option. |
Marker | string | An optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeClusterSnapshots request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request. |
MaxRecords | integer | The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. Default: 100 Constraints: minimum 20, maximum 100. |
OwnerAccount | string | The Amazon Web Services account used to create or copy the snapshot. Use this field to filter the results to snapshots owned by a particular account. To describe snapshots you own, either specify your Amazon Web Services account, or do not specify the parameter. |
SnapshotArn | string | The Amazon Resource Name (ARN) of the snapshot associated with the message to describe cluster snapshots. |
SnapshotClusterIdentifier | string | The unique identifier of the cluster the snapshot was created from. This parameter is required if your IAM user has a policy containing a snapshot resource element that specifies anything other than * for the cluster name. Constraints: Must be the name of valid cluster. |
SnapshotIdentifier | string | The snapshot identifier of the snapshot about which to return information. |
SnapshotType | string | The type of snapshots for which you are requesting information. By default, snapshots of all types are returned. Valid Values: automated | manual |
SortingEntities | array | |
StartTime | string (date-time) | A value that requests only snapshots created at or after the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia page. Example: 2012-07-16T18:00:00Z |
TagKeys | array | A tag key or keys for which you want to return all matching cluster snapshots that are associated with the specified key or keys. For example, suppose that you have snapshots that are tagged with keys called owner and environment. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag keys associated with them. |
TagValues | array | A tag value or values for which you want to return all matching cluster snapshots that are associated with the specified tag value or values. For example, suppose that you have snapshots that are tagged with values called admin and test. If you specify both of these tag values in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag values associated with them. |
Tags | array | A list of tag instances. |
SELECT examples
- describe_cluster_snapshots
Returns one or more snapshot objects, which contain metadata about your cluster snapshots. By default, this operation returns information about all snapshots of all clusters that are owned by your Amazon Web Services account. No information is returned for snapshots owned by inactive Amazon Web Services accounts. If you specify both tag keys and tag values in the same request, Amazon Redshift returns all snapshots that match any combination of the specified keys and values. For example, if you have owner and environment for tag keys, and admin and test for tag values, all snapshots that have any combination of those values are returned. Only snapshots that you own are returned in the response; shared snapshots are not returned with the tag key and tag value request parameters. If both tag keys and values are omitted from the request, snapshots are returned regardless of whether they have tag keys or values associated with them.
SELECT
accounts_with_restore_access,
actual_incremental_backup_size_in_mega_bytes,
availability_zone,
backup_progress_in_mega_bytes,
cluster_create_time,
cluster_identifier,
cluster_version,
current_backup_rate_in_mega_bytes_per_second,
db_name,
elapsed_time_in_seconds,
encrypted,
encrypted_with_hsm,
engine_full_version,
enhanced_vpc_routing,
estimated_seconds_to_completion,
kms_key_id,
maintenance_track_name,
manual_snapshot_remaining_days,
manual_snapshot_retention_period,
master_password_secret_arn,
master_password_secret_kms_key_id,
master_username,
node_type,
number_of_nodes,
owner_account,
port,
restorable_node_types,
snapshot_arn,
snapshot_create_time,
snapshot_identifier,
snapshot_retention_start_time,
snapshot_type,
source_region,
status,
tags,
total_backup_size_in_mega_bytes,
vpc_id
FROM aws.redshift.cluster_snapshots
WHERE region = '{{ region }}' -- required
AND ClusterIdentifier = '{{ ClusterIdentifier }}'
AND SnapshotIdentifier = '{{ SnapshotIdentifier }}'
AND SnapshotArn = '{{ SnapshotArn }}'
AND SnapshotType = '{{ SnapshotType }}'
AND StartTime = '{{ StartTime }}'
AND EndTime = '{{ EndTime }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Marker = '{{ Marker }}'
AND OwnerAccount = '{{ OwnerAccount }}'
AND TagKeys = '{{ TagKeys }}'
AND TagValues = '{{ TagValues }}'
AND ClusterExists = '{{ ClusterExists }}'
AND SortingEntities = '{{ SortingEntities }}'
;
INSERT examples
- create_cluster_snapshot
- Manifest
Creates a manual snapshot of the specified cluster. The cluster must be in the available state. For more information about working with snapshots, go to Amazon Redshift Snapshots in the Amazon Redshift Cluster Management Guide.
INSERT INTO aws.redshift.cluster_snapshots (
SnapshotIdentifier,
ClusterIdentifier,
region,
ManualSnapshotRetentionPeriod,
Tags
)
SELECT
'{{ SnapshotIdentifier }}',
'{{ ClusterIdentifier }}',
'{{ region }}',
'{{ ManualSnapshotRetentionPeriod }}',
'{{ Tags }}'
RETURNING
accounts_with_restore_access,
actual_incremental_backup_size_in_mega_bytes,
availability_zone,
backup_progress_in_mega_bytes,
cluster_create_time,
cluster_identifier,
cluster_version,
current_backup_rate_in_mega_bytes_per_second,
db_name,
elapsed_time_in_seconds,
encrypted,
encrypted_with_hsm,
engine_full_version,
enhanced_vpc_routing,
estimated_seconds_to_completion,
kms_key_id,
maintenance_track_name,
manual_snapshot_remaining_days,
manual_snapshot_retention_period,
master_password_secret_arn,
master_password_secret_kms_key_id,
master_username,
node_type,
number_of_nodes,
owner_account,
port,
restorable_node_types,
snapshot_arn,
snapshot_create_time,
snapshot_identifier,
snapshot_retention_start_time,
snapshot_type,
source_region,
status,
tags,
total_backup_size_in_mega_bytes,
vpc_id
;
# Description fields are for documentation purposes
- name: cluster_snapshots
props:
- name: SnapshotIdentifier
value: "{{ SnapshotIdentifier }}"
description: Required parameter for the cluster_snapshots resource.
- name: ClusterIdentifier
value: "{{ ClusterIdentifier }}"
description: Required parameter for the cluster_snapshots resource.
- name: region
value: "{{ region }}"
description: Required parameter for the cluster_snapshots resource.
- name: ManualSnapshotRetentionPeriod
value: {{ ManualSnapshotRetentionPeriod }}
description: The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely. The value must be either -1 or an integer between 1 and 3,653. The default value is -1.
description: The number of days that a manual snapshot is retained. If the value is -1, the manual snapshot is retained indefinitely. The value must be either -1 or an integer between 1 and 3,653. The default value is -1.
- name: Tags
value: "{{ Tags }}"
description: A list of tag instances.
description: A list of tag instances.
UPDATE examples
- modify_cluster_snapshot
Modifies the settings for a snapshot. This exanmple modifies the manual retention period setting for a cluster snapshot.
UPDATE aws.redshift.cluster_snapshots
SET
-- No updatable properties
WHERE
SnapshotIdentifier = '{{ SnapshotIdentifier }}' --required
AND region = '{{ region }}' --required
AND ManualSnapshotRetentionPeriod = '{{ ManualSnapshotRetentionPeriod}}'
AND Force = {{ Force}}
RETURNING
accounts_with_restore_access,
actual_incremental_backup_size_in_mega_bytes,
availability_zone,
backup_progress_in_mega_bytes,
cluster_create_time,
cluster_identifier,
cluster_version,
current_backup_rate_in_mega_bytes_per_second,
db_name,
elapsed_time_in_seconds,
encrypted,
encrypted_with_hsm,
engine_full_version,
enhanced_vpc_routing,
estimated_seconds_to_completion,
kms_key_id,
maintenance_track_name,
manual_snapshot_remaining_days,
manual_snapshot_retention_period,
master_password_secret_arn,
master_password_secret_kms_key_id,
master_username,
node_type,
number_of_nodes,
owner_account,
port,
restorable_node_types,
snapshot_arn,
snapshot_create_time,
snapshot_identifier,
snapshot_retention_start_time,
snapshot_type,
source_region,
status,
tags,
total_backup_size_in_mega_bytes,
vpc_id;
DELETE examples
- delete_cluster_snapshot
Deletes the specified manual snapshot. The snapshot must be in the available state, with no other users authorized to access the snapshot. Unlike automated snapshots, manual snapshots are retained even after you delete your cluster. Amazon Redshift does not delete your manual snapshots. You must delete manual snapshot explicitly to avoid getting charged. If other accounts are authorized to access the snapshot, you must revoke all of the authorizations before you can delete the snapshot.
DELETE FROM aws.redshift.cluster_snapshots
WHERE SnapshotIdentifier = '{{ SnapshotIdentifier }}' --required
AND region = '{{ region }}' --required
AND SnapshotClusterIdentifier = '{{ SnapshotClusterIdentifier }}'
;
Lifecycle Methods
- batch_delete_cluster_snapshots
- batch_modify_cluster_snapshots
Deletes a set of cluster snapshots.
EXEC aws.redshift.cluster_snapshots.batch_delete_cluster_snapshots
@Identifiers='{{ Identifiers }}' --required,
@region='{{ region }}' --required
;
Modifies the settings for a set of cluster snapshots.
EXEC aws.redshift.cluster_snapshots.batch_modify_cluster_snapshots
@SnapshotIdentifierList='{{ SnapshotIdentifierList }}' --required,
@region='{{ region }}' --required,
@ManualSnapshotRetentionPeriod='{{ ManualSnapshotRetentionPeriod }}',
@Force={{ Force }}
;