Skip to main content

locked_snapshots

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

Overview

Namelocked_snapshots
TypeResource
Idaws.ec2.locked_snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
cool_off_periodintegerThe compliance mode cooling-off period, in hours.
cool_off_period_expires_onstringThe date and time at which the compliance mode cooling-off period expires, in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ).
lock_created_onstringThe date and time at which the snapshot was locked, in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ).
lock_durationintegerThe period of time for which the snapshot is locked, in days.
lock_duration_start_timestringThe date and time at which the lock duration started, in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ). If you lock a snapshot that is in the pending state, the lock duration starts only once the snapshot enters the completed state.
lock_expires_onstringThe date and time at which the lock will expire, in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ).
lock_statestringThe state of the snapshot lock. Valid states include: compliance-cooloff - The snapshot has been locked in compliance mode but it is still within the cooling-off period. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions. governance - The snapshot is locked in governance mode. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions. compliance - The snapshot is locked in compliance mode and the cooling-off period has expired. The snapshot can't be unlocked or deleted. The lock duration can only be increased by users with appropriate permissions. expired - The snapshot was locked in compliance or governance mode but the lock duration has expired. The snapshot is not locked and can be deleted.
owner_idstringThe account ID of the Amazon Web Services account that owns the snapshot.
snapshot_idstringThe ID of the snapshot.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_locked_snapshotsselectregionFilter, MaxResults, NextToken, SnapshotId, DryRunDescribes the lock status for a snapshot.

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)
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayThe filters. lock-state - The state of the snapshot lock (compliance-cooloff | governance | compliance | expired).
MaxResultsintegerThe maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
NextTokenstringThe token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
SnapshotIdarrayThe IDs of the snapshots for which to view the lock status.

SELECT examples

Describes the lock status for a snapshot.

SELECT
cool_off_period,
cool_off_period_expires_on,
lock_created_on,
lock_duration,
lock_duration_start_time,
lock_expires_on,
lock_state,
owner_id,
snapshot_id
FROM aws.ec2.locked_snapshots
WHERE region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND SnapshotId = '{{ SnapshotId }}'
AND DryRun = '{{ DryRun }}'
;