snapshots
Creates, updates, deletes, gets or lists a snapshots resource.
Overview
| Name | snapshots |
| Type | Resource |
| Id | aws.ds.snapshots |
Fields
The following fields are returned by SELECT queries:
- describe_snapshots
| Name | Datatype | Description |
|---|---|---|
directory_id | string | The directory identifier. (pattern: <code>^d-[0-9a-f]{10}$</code>) |
name | string | The descriptive name of the snapshot. (pattern: <code>^([a-zA-Z0-9_])[\a-zA-Z0-9_@#%+=:?./!\s-]$</code>) |
snapshot_id | string | The snapshot identifier. (pattern: <code>^s-[0-9a-f]{10}$</code>) |
start_time | string (date-time) | The date and time that the snapshot was taken. |
status | string | The snapshot status. (Creating, Completed, Failed) |
type | string | The snapshot type. (Auto, Manual) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_snapshots | select | region | 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. | |
create_snapshot | insert | region, DirectoryId | 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. | |
delete_snapshot | delete | region | Deletes a directory snapshot. | |
restore_from_snapshot | exec | region, SnapshotId | 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. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_snapshots
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
- create_snapshot
- Manifest
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
;
# Description fields are for documentation purposes
- name: snapshots
props:
- name: region
value: "{{ region }}"
description: Required parameter for the snapshots resource.
- name: DirectoryId
value: "{{ DirectoryId }}"
description: |
The identifier of the directory of which to take a snapshot.
- name: Name
value: "{{ Name }}"
description: |
The descriptive name to apply to the snapshot.
DELETE examples
- delete_snapshot
Deletes a directory snapshot.
DELETE FROM aws.ds.snapshots
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- restore_from_snapshot
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 }}"
}'
;