Skip to main content

cluster_snapshots

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

Overview

Namecluster_snapshots
TypeResource
Idaws.redshift.cluster_snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
accounts_with_restore_accessstringA 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_bytesnumberThe size of the incremental backup.
availability_zonestringThe Availability Zone in which the cluster was created.
backup_progress_in_mega_bytesnumberThe number of megabytes that have been transferred to the snapshot backup.
cluster_create_timestringThe time (UTC) when the cluster was originally created.
cluster_identifierstringThe identifier of the cluster for which the snapshot was taken.
cluster_versionstringThe version ID of the Amazon Redshift engine that is running on the cluster.
current_backup_rate_in_mega_bytes_per_secondnumberThe number of megabytes per second being transferred to the snapshot backup. Returns 0 for a completed backup.
db_namestringThe name of the database that was created when the cluster was created.
elapsed_time_in_secondsintegerThe amount of time an in-progress snapshot backup has been running, or the amount of time it took a completed backup to finish.
encryptedbooleanIf true, the data in the snapshot is encrypted at rest.
encrypted_with_hsmbooleanA 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_versionstringThe cluster version of the cluster used to create the snapshot. For example, 1.0.15503.
enhanced_vpc_routingbooleanAn 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_completionintegerThe estimate of the time remaining before the snapshot backup will complete. Returns 0 for a completed backup.
kms_key_idstringThe 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_namestringThe name of the maintenance track for the snapshot.
manual_snapshot_remaining_daysintegerThe number of days until a manual snapshot will pass its retention period.
manual_snapshot_retention_periodintegerThe 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_arnstringThe Amazon Resource Name (ARN) for the cluster's admin user credentials secret.
master_password_secret_kms_key_idstringThe ID of the Key Management Service (KMS) key used to encrypt and store the cluster's admin credentials secret.
master_usernamestringThe admin user name for the cluster.
node_typestringThe node type of the nodes in the cluster.
number_of_nodesintegerThe number of nodes in the cluster.
owner_accountstringFor 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.
portintegerThe port that the cluster is listening on.
restorable_node_typesstringThe list of node types that this cluster snapshot is able to restore into.
snapshot_arnstringThe Amazon Resource Name (ARN) of the snapshot.
snapshot_create_timestringThe 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_identifierstringThe snapshot identifier that is provided in the request.
snapshot_retention_start_timestringA timestamp representing the start of the retention period for the snapshot.
snapshot_typestringThe snapshot type. Snapshots created using CreateClusterSnapshot and CopyClusterSnapshot are of type "manual".
source_regionstringThe source region from which the snapshot was copied.
statusstringThe 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".
tagsstringThe list of tags for the cluster snapshot.
total_backup_size_in_mega_bytesnumberThe size of the complete set of backup data that would be used to restore the cluster.
vpc_idstringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_cluster_snapshotsselectregionClusterIdentifier, SnapshotIdentifier, SnapshotArn, SnapshotType, StartTime, EndTime, MaxRecords, Marker, OwnerAccount, TagKeys, TagValues, ClusterExists, SortingEntitiesReturns 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_snapshotinsertSnapshotIdentifier, ClusterIdentifier, regionManualSnapshotRetentionPeriod, TagsCreates 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_snapshotupdateSnapshotIdentifier, regionManualSnapshotRetentionPeriod, ForceModifies the settings for a snapshot. This exanmple modifies the manual retention period setting for a cluster snapshot.
delete_cluster_snapshotdeleteSnapshotIdentifier, regionSnapshotClusterIdentifierDeletes 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_snapshotsexecIdentifiers, regionDeletes a set of cluster snapshots.
batch_modify_cluster_snapshotsexecSnapshotIdentifierList, regionManualSnapshotRetentionPeriod, ForceModifies 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.

NameDatatypeDescription
ClusterIdentifierstringThe cluster identifier for which you want a snapshot.
IdentifiersarrayA list of identifiers for the snapshots that you want to delete.
SnapshotIdentifierstringThe 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.
SnapshotIdentifierListarrayA list of snapshot identifiers you want to modify.
regionstringAWS region (default: us-east-1)
ClusterExistsbooleanA 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.
ClusterIdentifierstringThe identifier of the cluster which generated the requested snapshots.
EndTimestring (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
ForcebooleanA boolean value indicating whether to override an exception if the retention period has passed.
ManualSnapshotRetentionPeriodintegerThe 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.
MarkerstringAn 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.
MaxRecordsintegerThe 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.
OwnerAccountstringThe 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.
SnapshotArnstringThe Amazon Resource Name (ARN) of the snapshot associated with the message to describe cluster snapshots.
SnapshotClusterIdentifierstringThe 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.
SnapshotIdentifierstringThe snapshot identifier of the snapshot about which to return information.
SnapshotTypestringThe type of snapshots for which you are requesting information. By default, snapshots of all types are returned. Valid Values: automated | manual
SortingEntitiesarray
StartTimestring (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
TagKeysarrayA 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.
TagValuesarrayA 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.
TagsarrayA list of tag instances.

SELECT examples

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

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
;

UPDATE examples

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

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

Deletes a set of cluster snapshots.

EXEC aws.redshift.cluster_snapshots.batch_delete_cluster_snapshots
@Identifiers='{{ Identifiers }}' --required,
@region='{{ region }}' --required
;