backup_selections
Creates, updates, deletes, gets or lists a backup_selections resource.
Overview
| Name | backup_selections |
| Type | Resource |
| Id | aws.backup.backup_selections |
Fields
The following fields are returned by SELECT queries:
- get_backup_selection
- list_backup_selections
| Name | Datatype | Description |
|---|---|---|
backup_plan_id | string | Uniquely identifies a backup plan. |
backup_selection | object | Used 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_date | string (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_id | string | A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. |
selection_id | string | Uniquely identifies the body of a request to assign a set of resources to a backup plan. |
| Name | Datatype | Description |
|---|---|---|
backup_plan_id | string | Uniquely identifies a backup plan. |
creation_date | string (date-time) | The date and time a backup plan 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_id | string | A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters. |
iam_role_arn | string | Specifies the IAM role Amazon Resource Name (ARN) to create the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access. |
selection_id | string | Uniquely identifies a request to assign a set of resources to a backup plan. |
selection_name | string | The display name of a resource selection document. (pattern: <code>^[a-zA-Z0-9-_.]{1,50}$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_backup_selection | select | backup_plan_id, selection_id, region | Returns selection metadata and a document in JSON format that specifies a list of resources that are associated with a backup plan. | |
list_backup_selections | select | backup_plan_id, region | nextToken, maxResults | Returns an array containing metadata of the resources associated with the target backup plan. |
create_backup_selection | insert | backup_plan_id, region, BackupSelection | Creates a JSON document that specifies a set of resources to assign to a backup plan. For examples, see Assigning resources programmatically. | |
delete_backup_selection | delete | backup_plan_id, selection_id, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
backup_plan_id | string | Uniquely identifies a backup plan. |
region | string | AWS region (default: us-east-1) |
selection_id | string | Uniquely identifies the body of a request to assign a set of resources to a backup plan. |
maxResults | integer | The maximum number of items to be returned. |
nextToken | string | The 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
- get_backup_selection
- list_backup_selections
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
;
Returns an array containing metadata of the resources associated with the target backup plan.
SELECT
backup_plan_id,
creation_date,
creator_request_id,
iam_role_arn,
selection_id,
selection_name
FROM aws.backup.backup_selections
WHERE backup_plan_id = '{{ backup_plan_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;
INSERT examples
- create_backup_selection
- Manifest
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
;
# Description fields are for documentation purposes
- name: backup_selections
props:
- name: backup_plan_id
value: "{{ backup_plan_id }}"
description: Required parameter for the backup_selections resource.
- name: region
value: "{{ region }}"
description: Required parameter for the backup_selections resource.
- name: BackupSelection
description: |
Used 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.
value:
SelectionName: "{{ SelectionName }}"
IamRoleArn: "{{ IamRoleArn }}"
Resources:
- "{{ Resources }}"
ListOfTags:
- ConditionType: "{{ ConditionType }}"
ConditionKey: "{{ ConditionKey }}"
ConditionValue: "{{ ConditionValue }}"
NotResources:
- "{{ NotResources }}"
Conditions:
StringEquals:
- ConditionKey: "{{ ConditionKey }}"
ConditionValue: "{{ ConditionValue }}"
StringNotEquals:
- ConditionKey: "{{ ConditionKey }}"
ConditionValue: "{{ ConditionValue }}"
StringLike:
- ConditionKey: "{{ ConditionKey }}"
ConditionValue: "{{ ConditionValue }}"
StringNotLike:
- ConditionKey: "{{ ConditionKey }}"
ConditionValue: "{{ ConditionValue }}"
- name: CreatorRequestId
value: "{{ CreatorRequestId }}"
DELETE examples
- delete_backup_selection
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
;