Skip to main content

legal_holds

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

Overview

Namelegal_holds
TypeResource
Idaws.backup.legal_holds

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
cancel_descriptionstringThe reason for removing the legal hold.
cancellation_datestring (date-time)The time when the legal hold was cancelled.
creation_datestring (date-time)The time when the legal hold was created.
descriptionstringThe description of the legal hold.
legal_hold_arnstringThe framework ARN for the specified legal hold. The format of the ARN depends on the resource type.
legal_hold_idstringThe ID of the legal hold.
recovery_point_selectionobjectThis specifies criteria to assign a set of resources, such as resource types or backup vaults.
retain_record_untilstring (date-time)The date and time until which the legal hold record is retained.
statusstringThe status of the legal hold. (CREATING, ACTIVE, CANCELING, CANCELED)
titlestringThe title of the legal hold.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_legal_holdselectlegal_hold_id, regionThis action returns details for a specified legal hold. The details are the body of a legal hold in JSON format, in addition to metadata.
list_legal_holdsselectregionnextToken, maxResultsThis action returns metadata about active and previous legal holds.
create_legal_holdinsertregionCreates a legal hold on a recovery point (backup). A legal hold is a restraint on altering or deleting a backup until an authorized user cancels the legal hold. Any actions to delete or disassociate a recovery point will fail with an error if one or more active legal holds are on the recovery point.
cancel_legal_holdexeclegal_hold_id, cancelDescription, regionretainRecordInDaysRemoves the specified legal hold on a recovery point. This action can only be performed by a user with sufficient permissions.

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
cancelDescriptionstringA string the describes the reason for removing the legal hold.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of resource list items to be returned.
nextTokenstringThe next item following a partial list of returned resources. For example, if a request is made to return MaxResults number of resources, NextToken allows you to return more items in your list starting at the location pointed to by the next token.
retainRecordInDaysinteger (int64)The integer amount, in days, after which to remove legal hold.

SELECT examples

This action returns details for a specified legal hold. The details are the body of a legal hold in JSON format, in addition to metadata.

SELECT
cancel_description,
cancellation_date,
creation_date,
description,
legal_hold_arn,
legal_hold_id,
recovery_point_selection,
retain_record_until,
status,
title
FROM aws.backup.legal_holds
WHERE legal_hold_id = '{{ legal_hold_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a legal hold on a recovery point (backup). A legal hold is a restraint on altering or deleting a backup until an authorized user cancels the legal hold. Any actions to delete or disassociate a recovery point will fail with an error if one or more active legal holds are on the recovery point.

INSERT INTO aws.backup.legal_holds (
Title,
Description,
IdempotencyToken,
RecoveryPointSelection,
Tags,
region
)
SELECT
'{{ Title }}',
'{{ Description }}',
'{{ IdempotencyToken }}',
'{{ RecoveryPointSelection }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
creation_date,
description,
legal_hold_arn,
legal_hold_id,
recovery_point_selection,
status,
title
;

Lifecycle Methods

Removes the specified legal hold on a recovery point. This action can only be performed by a user with sufficient permissions.

EXEC aws.backup.legal_holds.cancel_legal_hold
@legal_hold_id='{{ legal_hold_id }}' --required,
@cancelDescription='{{ cancelDescription }}' --required,
@region='{{ region }}' --required,
@retainRecordInDays='{{ retainRecordInDays }}'
;