test_runs
Creates, updates, deletes, gets or lists a test_runs resource.
Overview
| Name | test_runs |
| Type | Resource |
| Id | aws.resiliencehubv2.test_runs |
Fields
The following fields are returned by SELECT queries:
- get_test_run
- list_test_runs
| Name | Datatype | Description |
|---|---|---|
account_targeting | string | Indicates whether this test run targets a single account or multiple accounts. (SINGLE_ACCOUNT, MULTI_ACCOUNT) |
ended_at | string (date-time) | The timestamp when the test run ended. |
error_message | string | A human-readable reason for test run failure. Only present when the status is FAILED or ERROR. |
event_count | integer | The number of events recorded for the test run. Use ListTestRunEvents to retrieve the details. |
experiments | array | The AWS Fault Injection Service (AWS FIS) experiments run as part of the test run. |
logging_configuration | object | Configuration for test execution logging destinations. |
parameters | object | The parameter values used for the test run. |
permission_model | object | Defines the permission model for a service. |
policy | object | The resilience policy snapshotted from the service when the run was started. |
region_switch_execution_id | string | The identifier of the ARC Region switch execution detected during the test run. (pattern: <code>[a-z]{2}(-[a-z]+)+-[0-9]+/[0-9a-fA-F]{16}</code>) |
region_switch_plan_arn | string | ARN identifier. (pattern: <code>arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}</code>) |
regions | array | The Regions snapshotted from the service when the run was started. |
report_configuration | object | The report configuration snapshotted from the service when the run was started. |
report_output | object | The report generation result for the test run. Present after report generation completes or fails. |
role_name | string | Resource name (used in ARN — no spaces allowed). (pattern: <code>[A-Za-z0-9][A-Za-z0-9_-]{1,59}</code>) |
service_arn | string | ARN identifier. (pattern: <code>arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}</code>) |
started_at | string (date-time) | The timestamp when the test run started. |
status | string | The current status of the test run. (INITIALIZING, RUNNING, STOPPING, PASSED, FAILED, STOPPED, ERROR) |
stop_conditions | array | The stop conditions snapshotted from the test when the run was started. |
test_id | string | The unique identifier of a test. |
test_run_id | string | The unique identifier of a test run. |
test_template_arn | string | An ARN owned by the service. Accepts either a standard 12-digit account ID or the literal "aws" for AWS-managed resources, such as AWS-managed test templates. (pattern: <code>arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):([0-9]{12}|aws):[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}</code>) |
| Name | Datatype | Description |
|---|---|---|
account_targeting | string | Indicates whether this test run targets a single account or multiple accounts. (SINGLE_ACCOUNT, MULTI_ACCOUNT) |
ended_at | string (date-time) | The timestamp when the test run ended. |
error_message | string | A human-readable reason for test run failure. Only present when the status is FAILED or ERROR. |
service_arn | string | ARN identifier. (pattern: <code>arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):[0-9]{12}:[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}</code>) |
started_at | string (date-time) | The timestamp when the test run started. |
status | string | The current status of the test run. (INITIALIZING, RUNNING, STOPPING, PASSED, FAILED, STOPPED, ERROR) |
test_run_id | string | The unique identifier of a test run. |
test_template_arn | string | An ARN owned by the service. Accepts either a standard 12-digit account ID or the literal "aws" for AWS-managed resources, such as AWS-managed test templates. (pattern: <code>arn:(aws|aws-cn|aws-iso|aws-iso-[a-z]{1}|aws-us-gov):[A-Za-z0-9][A-Za-z0-9_/.-]{0,62}:([a-z]{2}-((iso[a-z]{0,1}-)|(gov-)){0,1}[a-z]+-[0-9]):([0-9]{12}|aws):[A-Za-z0-9/][A-Za-z0-9:_/+.-]{0,1023}</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_test_run | select | testRunId, serviceArn, region | Retrieves a test run by ID, including its status, results, and the configuration snapshotted when the run started. | |
list_test_runs | select | serviceArn, region | testId, maxResults, nextToken | Lists the runs of a test, or all test runs for a service. |
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) |
serviceArn | string | The ARN of the service to list test runs for. |
testRunId | string | The identifier of the test run to retrieve. |
maxResults | integer | |
nextToken | string | |
testId | string | Filter test runs by test identifier. |
SELECT examples
- get_test_run
- list_test_runs
Retrieves a test run by ID, including its status, results, and the configuration snapshotted when the run started.
SELECT
account_targeting,
ended_at,
error_message,
event_count,
experiments,
logging_configuration,
parameters,
permission_model,
policy,
region_switch_execution_id,
region_switch_plan_arn,
regions,
report_configuration,
report_output,
role_name,
service_arn,
started_at,
status,
stop_conditions,
test_id,
test_run_id,
test_template_arn
FROM aws.resiliencehubv2.test_runs
WHERE testRunId = '{{ testRunId }}' -- required
AND serviceArn = '{{ serviceArn }}' -- required
AND region = '{{ region }}' -- required
;
Lists the runs of a test, or all test runs for a service.
SELECT
account_targeting,
ended_at,
error_message,
service_arn,
started_at,
status,
test_run_id,
test_template_arn
FROM aws.resiliencehubv2.test_runs
WHERE serviceArn = '{{ serviceArn }}' -- required
AND region = '{{ region }}' -- required
AND testId = '{{ testId }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;