Skip to main content

snapshots

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

Overview

Namesnapshots
TypeResource
Idaws.fsx.snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
administrative_actionsarrayA list of administrative actions for the file system that are in process or waiting to be processed. Administrative actions describe changes to the Amazon FSx system.
creation_timestring (date-time)The time that the resource was created, in seconds (since 1970-01-01T00:00:00Z), also known as Unix time.
lifecyclestringThe lifecycle status of the snapshot. PENDING - Amazon FSx hasn't started creating the snapshot. CREATING - Amazon FSx is creating the snapshot. DELETING - Amazon FSx is deleting the snapshot. AVAILABLE - The snapshot is fully available. (PENDING, CREATING, DELETING, AVAILABLE)
lifecycle_transition_reasonobjectDescribes why a resource lifecycle state changed.
namestringThe name of the snapshot. (pattern: <code>^[a-zA-Z0-9_:.-]{1,203}$</code>)
resource_arnstringThe Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify Amazon Web Services resources. We require an ARN when you need to specify a resource unambiguously across all of Amazon Web Services. For more information, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference. (pattern: <code>^arn:(?=[^:]+:fsx:[^:]+:\d{12}:)((|(?=[a-z0-9-.]{1,63})(?!\d{1,3}(.\d{1,3}){3})(?![^:]-{2})(?![^:]-.)(?![^:].-)[a-z0-9].(?<!-)):){4}(?!/).{0,1024}$</code>)
snapshot_idstringThe ID of the snapshot. (pattern: <code>^((fs)?volsnap-[0-9a-f]{8,})$</code>)
tagsarrayA list of Tag values, with a maximum of 50 elements.
volume_idstringThe ID of the volume that the snapshot is of. (pattern: <code>^(fsvol-[0-9a-f]{17,})$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_snapshotsselectregionReturns the description of specific Amazon FSx for OpenZFS snapshots, if a SnapshotIds value is provided. Otherwise, this operation returns all snapshots owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling. When retrieving all snapshots, you can optionally specify the MaxResults parameter to limit the number of snapshots in a response. If more backups remain, Amazon FSx returns a NextToken value in the response. In this case, send a later request with the NextToken request parameter set to the value of NextToken from the last response. Use this operation in an iterative process to retrieve a list of your snapshots. DescribeSnapshots is called first without a NextToken value. Then the operation continues to be called with the NextToken parameter set to the value of the last NextToken value until a response has no NextToken value. When using this operation, keep the following in mind: The operation might return fewer than the MaxResults value of snapshot descriptions while still including a NextToken value. The order of snapshots returned in the response of one DescribeSnapshots call and the order of backups returned across the responses of a multi-call iteration is unspecified.
create_snapshotinsertregion, VolumeIdCreates a snapshot of an existing Amazon FSx for OpenZFS volume. With snapshots, you can easily undo file changes and compare file versions by restoring the volume to a previous version. If a snapshot with the specified client request token exists, and the parameters match, this operation returns the description of the existing snapshot. If a snapshot with the specified client request token exists, and the parameters don't match, this operation returns IncompatibleParameterError. If a snapshot with the specified client request token doesn't exist, CreateSnapshot does the following: Creates a new OpenZFS snapshot with an assigned ID, and an initial lifecycle state of CREATING. Returns the description of the snapshot. By using the idempotent operation, you can retry a CreateSnapshot operation without the risk of creating an extra snapshot. This approach can be useful when an initial call fails in a way that makes it unclear whether a snapshot was created. If you use the same client request token and the initial call created a snapshot, the operation returns a successful result because all the parameters are the same. The CreateSnapshot operation returns while the snapshot's lifecycle state is still CREATING. You can check the snapshot creation status by calling the DescribeSnapshots operation, which returns the snapshot state along with other information.
update_snapshotupdateregion, SnapshotIdUpdates the name of an Amazon FSx for OpenZFS snapshot.
delete_snapshotdeleteregionDeletes an Amazon FSx for OpenZFS snapshot. After deletion, the snapshot no longer exists, and its data is gone. Deleting a snapshot doesn't affect snapshots stored in a file system backup. The DeleteSnapshot operation returns instantly. The snapshot appears with the lifecycle status of DELETING until the deletion is complete.
copy_snapshot_and_update_volumeexecregion, VolumeId, SourceSnapshotARNUpdates an existing volume by using a snapshot from another Amazon FSx for OpenZFS file system. For more information, see on-demand data replication in the Amazon FSx for OpenZFS User Guide.

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 the description of specific Amazon FSx for OpenZFS snapshots, if a SnapshotIds value is provided. Otherwise, this operation returns all snapshots owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling. When retrieving all snapshots, you can optionally specify the MaxResults parameter to limit the number of snapshots in a response. If more backups remain, Amazon FSx returns a NextToken value in the response. In this case, send a later request with the NextToken request parameter set to the value of NextToken from the last response. Use this operation in an iterative process to retrieve a list of your snapshots. DescribeSnapshots is called first without a NextToken value. Then the operation continues to be called with the NextToken parameter set to the value of the last NextToken value until a response has no NextToken value. When using this operation, keep the following in mind: The operation might return fewer than the MaxResults value of snapshot descriptions while still including a NextToken value. The order of snapshots returned in the response of one DescribeSnapshots call and the order of backups returned across the responses of a multi-call iteration is unspecified.

SELECT
administrative_actions,
creation_time,
lifecycle,
lifecycle_transition_reason,
name,
resource_arn,
snapshot_id,
tags,
volume_id
FROM aws.fsx.snapshots
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a snapshot of an existing Amazon FSx for OpenZFS volume. With snapshots, you can easily undo file changes and compare file versions by restoring the volume to a previous version. If a snapshot with the specified client request token exists, and the parameters match, this operation returns the description of the existing snapshot. If a snapshot with the specified client request token exists, and the parameters don't match, this operation returns IncompatibleParameterError. If a snapshot with the specified client request token doesn't exist, CreateSnapshot does the following: Creates a new OpenZFS snapshot with an assigned ID, and an initial lifecycle state of CREATING. Returns the description of the snapshot. By using the idempotent operation, you can retry a CreateSnapshot operation without the risk of creating an extra snapshot. This approach can be useful when an initial call fails in a way that makes it unclear whether a snapshot was created. If you use the same client request token and the initial call created a snapshot, the operation returns a successful result because all the parameters are the same. The CreateSnapshot operation returns while the snapshot's lifecycle state is still CREATING. You can check the snapshot creation status by calling the DescribeSnapshots operation, which returns the snapshot state along with other information.

INSERT INTO aws.fsx.snapshots (
ClientRequestToken,
Name,
VolumeId,
Tags,
region
)
SELECT
'{{ ClientRequestToken }}',
'{{ Name }}',
'{{ VolumeId }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
snapshot
;

UPDATE examples

Updates the name of an Amazon FSx for OpenZFS snapshot.

UPDATE aws.fsx.snapshots
SET
ClientRequestToken = '{{ ClientRequestToken }}',
Name = '{{ Name }}',
SnapshotId = '{{ SnapshotId }}'
WHERE
region = '{{ region }}' --required
AND SnapshotId = '{{ SnapshotId }}' --required
RETURNING
snapshot;

DELETE examples

Deletes an Amazon FSx for OpenZFS snapshot. After deletion, the snapshot no longer exists, and its data is gone. Deleting a snapshot doesn't affect snapshots stored in a file system backup. The DeleteSnapshot operation returns instantly. The snapshot appears with the lifecycle status of DELETING until the deletion is complete.

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

Lifecycle Methods

Updates an existing volume by using a snapshot from another Amazon FSx for OpenZFS file system. For more information, see on-demand data replication in the Amazon FSx for OpenZFS User Guide.

EXEC aws.fsx.snapshots.copy_snapshot_and_update_volume
@region='{{ region }}' --required
@@json=
'{
"ClientRequestToken": "{{ ClientRequestToken }}",
"VolumeId": "{{ VolumeId }}",
"SourceSnapshotARN": "{{ SourceSnapshotARN }}",
"CopyStrategy": "{{ CopyStrategy }}",
"Options": "{{ Options }}"
}'
;