Skip to main content

snapshots

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

Overview

Namesnapshots
TypeResource
Idaws.ds.snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
directory_idstringThe directory identifier. (pattern: <code>^d-[0-9a-f]{10}$</code>)
namestringThe descriptive name of the snapshot. (pattern: <code>^([a-zA-Z0-9_])[\a-zA-Z0-9_@#%+=:?./!\s-]$</code>)
snapshot_idstringThe snapshot identifier. (pattern: <code>^s-[0-9a-f]{10}$</code>)
start_timestring (date-time)The date and time that the snapshot was taken.
statusstringThe snapshot status. (Creating, Completed, Failed)
typestringThe snapshot type. (Auto, Manual)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_snapshotsselectregionObtains information about the directory snapshots that belong to this account. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeSnapshots.NextToken member contains a token that you pass in the next call to DescribeSnapshots to retrieve the next set of items. You can also specify a maximum number of return results with the Limit parameter.
create_snapshotinsertregion, DirectoryIdCreates a snapshot of a Simple AD or Microsoft AD directory in the Amazon Web Services cloud. You cannot take snapshots of AD Connector directories.
delete_snapshotdeleteregionDeletes a directory snapshot.
restore_from_snapshotexecregion, SnapshotIdRestores a directory using an existing directory snapshot. When you restore a directory from a snapshot, any changes made to the directory after the snapshot date are overwritten. This action returns as soon as the restore operation is initiated. You can monitor the progress of the restore operation by calling the DescribeDirectories operation with the directory identifier. When the DirectoryDescription.Stage value changes to Active, the restore operation is complete.

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

Obtains information about the directory snapshots that belong to this account. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeSnapshots.NextToken member contains a token that you pass in the next call to DescribeSnapshots to retrieve the next set of items. You can also specify a maximum number of return results with the Limit parameter.

SELECT
directory_id,
name,
snapshot_id,
start_time,
status,
type
FROM aws.ds.snapshots
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a snapshot of a Simple AD or Microsoft AD directory in the Amazon Web Services cloud. You cannot take snapshots of AD Connector directories.

INSERT INTO aws.ds.snapshots (
DirectoryId,
Name,
region
)
SELECT
'{{ DirectoryId }}' /* required */,
'{{ Name }}',
'{{ region }}'
RETURNING
snapshot_id
;

DELETE examples

Deletes a directory snapshot.

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

Lifecycle Methods

Restores a directory using an existing directory snapshot. When you restore a directory from a snapshot, any changes made to the directory after the snapshot date are overwritten. This action returns as soon as the restore operation is initiated. You can monitor the progress of the restore operation by calling the DescribeDirectories operation with the directory identifier. When the DirectoryDescription.Stage value changes to Active, the restore operation is complete.

EXEC aws.ds.snapshots.restore_from_snapshot
@region='{{ region }}' --required
@@json=
'{
"SnapshotId": "{{ SnapshotId }}"
}'
;