test_sources
Creates, updates, deletes, gets or lists a test_sources resource.
Overview
| Name | test_sources |
| Type | Resource |
| Id | aws.resiliencehubv2.test_sources |
Fields
The following fields are returned by SELECT queries:
- list_test_sources
| Name | Datatype | Description |
|---|---|---|
observability_alarm | object | A configured observability alarm. |
success_criteria_alarm | object | A configured success criteria alarm. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_test_sources | select | test_id, serviceArn, region | type, maxResults, nextToken | Lists the monitoring sources attached to a test, optionally filtered by type. |
put_test_sources | replace | region, testId, serviceArn, testSources | Adds or updates the monitoring sources on a test. The operation is transactional — either every source is written or the call fails and nothing is written. | |
delete_test_sources | delete | region | Removes monitoring sources from a test. The operation is transactional and idempotent — removing a source that is not attached is a no-op. |
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 the test belongs to. |
test_id | string | The identifier of the test to list sources for. |
maxResults | integer | |
nextToken | string | |
type | string | Filter sources by type. |
SELECT examples
- list_test_sources
Lists the monitoring sources attached to a test, optionally filtered by type.
SELECT
observability_alarm,
success_criteria_alarm
FROM aws.resiliencehubv2.test_sources
WHERE test_id = '{{ test_id }}' -- required
AND serviceArn = '{{ serviceArn }}' -- required
AND region = '{{ region }}' -- required
AND type = '{{ type }}'
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
REPLACE examples
- put_test_sources
Adds or updates the monitoring sources on a test. The operation is transactional — either every source is written or the call fails and nothing is written.
REPLACE aws.resiliencehubv2.test_sources
SET
testId = '{{ testId }}',
serviceArn = '{{ serviceArn }}',
testSources = '{{ testSources }}'
WHERE
region = '{{ region }}' --required
AND testId = '{{ testId }}' --required
AND serviceArn = '{{ serviceArn }}' --required
AND testSources = '{{ testSources }}' --required;
DELETE examples
- delete_test_sources
Removes monitoring sources from a test. The operation is transactional and idempotent — removing a source that is not attached is a no-op.
DELETE FROM aws.resiliencehubv2.test_sources
WHERE region = '{{ region }}' --required
;