restore_testing_selections
Creates, updates, deletes, gets or lists a restore_testing_selections resource.
Overview
| Name | restore_testing_selections |
| Type | Resource |
| Id | aws.backup.restore_testing_selections |
Fields
The following fields are returned by SELECT queries:
- get_restore_testing_selection
- list_restore_testing_selections
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | The date and time that a restore testing selection was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 201812:11:30.087 AM. |
creator_request_id | string | This identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a CreatorRequestId that matches an existing backup plan, that plan is returned. This parameter is optional. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters. |
iam_role_arn | string | The Amazon Resource Name (ARN) of the IAM role that Backup uses to create the target resource; for example:arn:aws:iam::123456789012:role/S3Access. |
protected_resource_arns | array | You can include specific ARNs, such as ProtectedResourceArns: ["arn:aws:...", "arn:aws:..."] or you can include a wildcard: ProtectedResourceArns: ["*"], but not both. |
protected_resource_conditions | object | In a resource testing selection, this parameter filters by specific conditions such as StringEquals or StringNotEquals. |
protected_resource_type | string | The type of Amazon Web Services resource included in a resource testing selection; for example, an Amazon EBS volume or an Amazon RDS database. |
restore_metadata_overrides | object | You can override certain restore metadata keys by including the parameter RestoreMetadataOverrides in the body of RestoreTestingSelection. Key values are not case sensitive. See the complete list of restore testing inferred metadata. |
restore_testing_plan_name | string | The RestoreTestingPlanName is a unique string that is the name of the restore testing plan. |
restore_testing_selection_name | string | The unique name of the restore testing selection that belongs to the related restore testing plan. The name consists of only alphanumeric characters and underscores. Maximum length is 50. |
validation_window_hours | integer | This is amount of hours (1 to 168) available to run a validation script on the data. The data will be deleted upon the completion of the validation script or the end of the specified retention period, whichever comes first. |
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | The date and time that a restore testing selection was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26,2018 12:11:30.087 AM. |
iam_role_arn | string | The Amazon Resource Name (ARN) of the IAM role that Backup uses to create the target resource; for example: arn:aws:iam::123456789012:role/S3Access. |
protected_resource_type | string | The type of Amazon Web Services resource included in a restore testing selection; for example, an Amazon EBS volume or an Amazon RDS database. |
restore_testing_plan_name | string | Unique string that is the name of the restore testing plan. The name cannot be changed after creation. The name must consist of only alphanumeric characters and underscores. Maximum length is 50. |
restore_testing_selection_name | string | Unique name of a restore testing selection. The name consists of only alphanumeric characters and underscores. Maximum length is 50. |
validation_window_hours | integer | This value represents the time, in hours, data is retained after a restore test so that optional validation can be completed. Accepted value is an integer between 0 and 168 (the hourly equivalent of seven days). |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_restore_testing_selection | select | restore_testing_plan_name, restore_testing_selection_name, region | Returns RestoreTestingSelection, which displays resources and elements of the restore testing plan. | |
list_restore_testing_selections | select | restore_testing_plan_name, region | MaxResults, NextToken | Returns a list of restore testing selections. Can be filtered by MaxResults and RestoreTestingPlanName. |
create_restore_testing_selection | insert | restore_testing_plan_name, region, RestoreTestingSelection | This request can be sent after CreateRestoreTestingPlan request returns successfully. This is the second part of creating a resource testing plan, and it must be completed sequentially. This consists of RestoreTestingSelectionName, ProtectedResourceType, and one of the following: ProtectedResourceArns ProtectedResourceConditions Each protected resource type can have one single value. A restore testing selection can include a wildcard value ("*") for ProtectedResourceArns along with ProtectedResourceConditions. Alternatively, you can include up to 30 specific protected resource ARNs in ProtectedResourceArns. Cannot select by both protected resource types AND specific ARNs. Request will fail if both are included. | |
update_restore_testing_selection | update | restore_testing_plan_name, restore_testing_selection_name, region, RestoreTestingSelection | Updates the specified restore testing selection. Most elements except the RestoreTestingSelectionName can be updated with this request. You can use either protected resource ARNs or conditions, but not both. | |
delete_restore_testing_selection | delete | restore_testing_plan_name, restore_testing_selection_name, region | Input the Restore Testing Plan name and Restore Testing Selection name. All testing selections associated with a restore testing plan must be deleted before the restore testing plan can be deleted. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
restore_testing_plan_name | string | Required unique name of the restore testing plan that contains the restore testing selection you wish to delete. |
restore_testing_selection_name | string | Required unique name of the restore testing selection you wish to delete. |
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 nexttoken. |
SELECT examples
- get_restore_testing_selection
- list_restore_testing_selections
Returns RestoreTestingSelection, which displays resources and elements of the restore testing plan.
SELECT
creation_time,
creator_request_id,
iam_role_arn,
protected_resource_arns,
protected_resource_conditions,
protected_resource_type,
restore_metadata_overrides,
restore_testing_plan_name,
restore_testing_selection_name,
validation_window_hours
FROM aws.backup.restore_testing_selections
WHERE restore_testing_plan_name = '{{ restore_testing_plan_name }}' -- required
AND restore_testing_selection_name = '{{ restore_testing_selection_name }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of restore testing selections. Can be filtered by MaxResults and RestoreTestingPlanName.
SELECT
creation_time,
iam_role_arn,
protected_resource_type,
restore_testing_plan_name,
restore_testing_selection_name,
validation_window_hours
FROM aws.backup.restore_testing_selections
WHERE restore_testing_plan_name = '{{ restore_testing_plan_name }}' -- required
AND region = '{{ region }}' -- required
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
INSERT examples
- create_restore_testing_selection
- Manifest
This request can be sent after CreateRestoreTestingPlan request returns successfully. This is the second part of creating a resource testing plan, and it must be completed sequentially. This consists of RestoreTestingSelectionName, ProtectedResourceType, and one of the following: ProtectedResourceArns ProtectedResourceConditions Each protected resource type can have one single value. A restore testing selection can include a wildcard value ("*") for ProtectedResourceArns along with ProtectedResourceConditions. Alternatively, you can include up to 30 specific protected resource ARNs in ProtectedResourceArns. Cannot select by both protected resource types AND specific ARNs. Request will fail if both are included.
INSERT INTO aws.backup.restore_testing_selections (
CreatorRequestId,
RestoreTestingSelection,
restore_testing_plan_name,
region
)
SELECT
'{{ CreatorRequestId }}',
'{{ RestoreTestingSelection }}' /* required */,
'{{ restore_testing_plan_name }}',
'{{ region }}'
RETURNING
creation_time,
restore_testing_plan_arn,
restore_testing_plan_name,
restore_testing_selection_name
;
# Description fields are for documentation purposes
- name: restore_testing_selections
props:
- name: restore_testing_plan_name
value: "{{ restore_testing_plan_name }}"
description: Required parameter for the restore_testing_selections resource.
- name: region
value: "{{ region }}"
description: Required parameter for the restore_testing_selections resource.
- name: CreatorRequestId
value: "{{ CreatorRequestId }}"
- name: RestoreTestingSelection
description: |
This contains metadata about a specific restore testing selection. ProtectedResourceType is required, such as Amazon EBS or Amazon EC2. This consists of RestoreTestingSelectionName, ProtectedResourceType, and one of the following: ProtectedResourceArns ProtectedResourceConditions Each protected resource type can have one single value. A restore testing selection can include a wildcard value ("*") for ProtectedResourceArns along with ProtectedResourceConditions. Alternatively, you can include up to 30 specific protected resource ARNs in ProtectedResourceArns. ProtectedResourceConditions examples include as StringEquals and StringNotEquals.
value:
IamRoleArn: "{{ IamRoleArn }}"
ProtectedResourceArns:
- "{{ ProtectedResourceArns }}"
ProtectedResourceConditions:
StringEquals:
- Key: "{{ Key }}"
Value: "{{ Value }}"
StringNotEquals:
- Key: "{{ Key }}"
Value: "{{ Value }}"
ProtectedResourceType: "{{ ProtectedResourceType }}"
RestoreMetadataOverrides: "{{ RestoreMetadataOverrides }}"
RestoreTestingSelectionName: "{{ RestoreTestingSelectionName }}"
ValidationWindowHours: {{ ValidationWindowHours }}
UPDATE examples
- update_restore_testing_selection
Updates the specified restore testing selection. Most elements except the RestoreTestingSelectionName can be updated with this request. You can use either protected resource ARNs or conditions, but not both.
UPDATE aws.backup.restore_testing_selections
SET
RestoreTestingSelection = '{{ RestoreTestingSelection }}'
WHERE
restore_testing_plan_name = '{{ restore_testing_plan_name }}' --required
AND restore_testing_selection_name = '{{ restore_testing_selection_name }}' --required
AND region = '{{ region }}' --required
AND RestoreTestingSelection = '{{ RestoreTestingSelection }}' --required
RETURNING
creation_time,
restore_testing_plan_arn,
restore_testing_plan_name,
restore_testing_selection_name,
update_time;
DELETE examples
- delete_restore_testing_selection
Input the Restore Testing Plan name and Restore Testing Selection name. All testing selections associated with a restore testing plan must be deleted before the restore testing plan can be deleted.
DELETE FROM aws.backup.restore_testing_selections
WHERE restore_testing_plan_name = '{{ restore_testing_plan_name }}' --required
AND restore_testing_selection_name = '{{ restore_testing_selection_name }}' --required
AND region = '{{ region }}' --required
;