Skip to main content

backup_selections

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

Overview

Namebackup_selections
TypeResource
Idaws.backup.backup_selections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
backup_plan_idstringUniquely identifies a backup plan.
backup_selectionobjectUsed to specify a set of resources to a backup plan. We recommend that you specify conditions, tags, or resources to include or exclude. Otherwise, Backup attempts to select all supported and opted-in storage resources, which could have unintended cost implications. For more information, see Assigning resources programmatically.
creation_datestring (date-time)The date and time a backup selection is created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.
creator_request_idstringA unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice.
selection_idstringUniquely identifies the body of a request to assign a set of resources to a backup plan.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_backup_selectionselectbackup_plan_id, selection_id, regionReturns selection metadata and a document in JSON format that specifies a list of resources that are associated with a backup plan.
list_backup_selectionsselectbackup_plan_id, regionnextToken, maxResultsReturns an array containing metadata of the resources associated with the target backup plan.
create_backup_selectioninsertbackup_plan_id, region, BackupSelectionCreates a JSON document that specifies a set of resources to assign to a backup plan. For examples, see Assigning resources programmatically.
delete_backup_selectiondeletebackup_plan_id, selection_id, regionDeletes the resource selection associated with a backup plan that is specified by the SelectionId.

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
backup_plan_idstringUniquely identifies a backup plan.
regionstringAWS region (default: us-east-1)
selection_idstringUniquely identifies the body of a request to assign a set of resources to a backup plan.
maxResultsintegerThe maximum number of items to be returned.
nextTokenstringThe next item following a partial list of returned items. For example, if a request is made to return MaxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

SELECT examples

Returns selection metadata and a document in JSON format that specifies a list of resources that are associated with a backup plan.

SELECT
backup_plan_id,
backup_selection,
creation_date,
creator_request_id,
selection_id
FROM aws.backup.backup_selections
WHERE backup_plan_id = '{{ backup_plan_id }}' -- required
AND selection_id = '{{ selection_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a JSON document that specifies a set of resources to assign to a backup plan. For examples, see Assigning resources programmatically.

INSERT INTO aws.backup.backup_selections (
BackupSelection,
CreatorRequestId,
backup_plan_id,
region
)
SELECT
'{{ BackupSelection }}' /* required */,
'{{ CreatorRequestId }}',
'{{ backup_plan_id }}',
'{{ region }}'
RETURNING
backup_plan_id,
creation_date,
selection_id
;

DELETE examples

Deletes the resource selection associated with a backup plan that is specified by the SelectionId.

DELETE FROM aws.backup.backup_selections
WHERE backup_plan_id = '{{ backup_plan_id }}' --required
AND selection_id = '{{ selection_id }}' --required
AND region = '{{ region }}' --required
;