EC2 / Client / describe_locked_snapshots

describe_locked_snapshots#

EC2.Client.describe_locked_snapshots(**kwargs)#

Describes the lock status for a snapshot.

See also: AWS API Documentation

Request Syntax

response = client.describe_locked_snapshots(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string',
    SnapshotIds=[
        'string',
    ],
    DryRun=True|False
)
Parameters:
  • Filters (list) –

    The filters.

    • lock-state - The state of the snapshot lock ( compliance-cooloff | governance | compliance | expired).

    • (dict) –

      A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

      If you specify multiple filters, the filters are joined with an AND, and the request returns only results that match all of the specified filters.

      • Name (string) –

        The name of the filter. Filter names are case-sensitive.

      • Values (list) –

        The filter values. Filter values are case-sensitive. If you specify multiple values for a filter, the values are joined with an OR, and the request returns all results that match any of the specified values.

        • (string) –

  • MaxResults (integer) – The 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.

  • NextToken (string) – The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

  • SnapshotIds (list) –

    The IDs of the snapshots for which to view the lock status.

    • (string) –

  • DryRun (boolean) – Checks 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.

Return type:

dict

Returns:

Response Syntax

{
    'Snapshots': [
        {
            'OwnerId': 'string',
            'SnapshotId': 'string',
            'LockState': 'compliance'|'governance'|'compliance-cooloff'|'expired',
            'LockDuration': 123,
            'CoolOffPeriod': 123,
            'CoolOffPeriodExpiresOn': datetime(2015, 1, 1),
            'LockCreatedOn': datetime(2015, 1, 1),
            'LockDurationStartTime': datetime(2015, 1, 1),
            'LockExpiresOn': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Snapshots (list) –

      Information about the snapshots.

      • (dict) –

        Information about a locked snapshot.

        • OwnerId (string) –

          The account ID of the Amazon Web Services account that owns the snapshot.

        • SnapshotId (string) –

          The ID of the snapshot.

        • LockState (string) –

          The 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.

        • LockDuration (integer) –

          The period of time for which the snapshot is locked, in days.

        • CoolOffPeriod (integer) –

          The compliance mode cooling-off period, in hours.

        • CoolOffPeriodExpiresOn (datetime) –

          The date and time at which the compliance mode cooling-off period expires, in the UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ).

        • LockCreatedOn (datetime) –

          The date and time at which the snapshot was locked, in the UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ).

        • LockDurationStartTime (datetime) –

          The 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.

        • LockExpiresOn (datetime) –

          The date and time at which the lock will expire, in the UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ).

    • NextToken (string) –

      The token to include in another request to get the next page of items. This value is null when there are no more items to return.