Skip to main content

snapshots

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

Overview

Namesnapshots
TypeResource
Idaws.redshift_serverless.snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
accounts_with_provisioned_restore_accessarrayAll of the Amazon Web Services accounts that have access to restore a snapshot to a provisioned cluster.
accounts_with_restore_accessarrayAll of the Amazon Web Services accounts that have access to restore a snapshot to a namespace.
actual_incremental_backup_size_in_mega_bytesnumber (double)The size of the incremental backup in megabytes.
admin_password_secret_arnstringThe Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
admin_password_secret_kms_key_idstringThe ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret.
admin_usernamestringThe username of the database within a snapshot.
backup_progress_in_mega_bytesnumber (double)The size in megabytes of the data that has been backed up to a snapshot.
current_backup_rate_in_mega_bytes_per_secondnumber (double)The rate at which data is backed up into a snapshot in megabytes per second.
elapsed_time_in_secondsinteger (int64)The amount of time it took to back up data into a snapshot.
estimated_seconds_to_completioninteger (int64)The estimated amount of seconds until the snapshot completes backup.
kms_key_idstringThe unique identifier of the KMS key used to encrypt the snapshot.
namespace_arnstringThe Amazon Resource Name (ARN) of the namespace the snapshot was created from.
namespace_namestringThe name of the namepsace.
owner_accountstringThe owner Amazon Web Services; account of the snapshot.
snapshot_arnstringThe Amazon Resource Name (ARN) of the snapshot.
snapshot_create_timestring (date-time)The timestamp of when the snapshot was created.
snapshot_namestringThe name of the snapshot.
snapshot_remaining_daysintegerThe amount of days until the snapshot is deleted.
snapshot_retention_periodintegerThe period of time, in days, of how long the snapshot is retained.
snapshot_retention_start_timestring (date-time)The timestamp of when data within the snapshot started getting retained.
statusstringThe status of the snapshot. (AVAILABLE, CREATING, DELETED, CANCELLED, FAILED, COPYING)
total_backup_size_in_mega_bytesnumber (double)The total size, in megabytes, of how big the snapshot is.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_snapshotselectregionReturns information about a specific snapshot.
list_snapshotsselectregionReturns a list of snapshots.
create_snapshotinsertregion, namespaceName, snapshotNameCreates a snapshot of all databases in a namespace. For more information about snapshots, see Working with snapshots and recovery points.
update_snapshotupdateregion, snapshotNameUpdates a snapshot.
delete_snapshotdeleteregionDeletes a snapshot from Amazon Redshift Serverless.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about a specific snapshot.

SELECT
accounts_with_provisioned_restore_access,
accounts_with_restore_access,
actual_incremental_backup_size_in_mega_bytes,
admin_password_secret_arn,
admin_password_secret_kms_key_id,
admin_username,
backup_progress_in_mega_bytes,
current_backup_rate_in_mega_bytes_per_second,
elapsed_time_in_seconds,
estimated_seconds_to_completion,
kms_key_id,
namespace_arn,
namespace_name,
owner_account,
snapshot_arn,
snapshot_create_time,
snapshot_name,
snapshot_remaining_days,
snapshot_retention_period,
snapshot_retention_start_time,
status,
total_backup_size_in_mega_bytes
FROM aws.redshift_serverless.snapshots
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a snapshot of all databases in a namespace. For more information about snapshots, see Working with snapshots and recovery points.

INSERT INTO aws.redshift_serverless.snapshots (
namespaceName,
retentionPeriod,
snapshotName,
tags,
region
)
SELECT
'{{ namespaceName }}' /* required */,
{{ retentionPeriod }},
'{{ snapshotName }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
snapshot
;

UPDATE examples

Updates a snapshot.

UPDATE aws.redshift_serverless.snapshots
SET
retentionPeriod = {{ retentionPeriod }},
snapshotName = '{{ snapshotName }}'
WHERE
region = '{{ region }}' --required
AND snapshotName = '{{ snapshotName }}' --required
RETURNING
snapshot;

DELETE examples

Deletes a snapshot from Amazon Redshift Serverless.

DELETE FROM aws.redshift_serverless.snapshots
WHERE region = '{{ region }}' --required
;