Skip to main content

test_sources

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

Overview

Nametest_sources
TypeResource
Idaws.resiliencehubv2.test_sources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
observability_alarmobjectA configured observability alarm.
success_criteria_alarmobjectA configured success criteria alarm.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_test_sourcesselecttest_id, serviceArn, regiontype, maxResults, nextTokenLists the monitoring sources attached to a test, optionally filtered by type.
put_test_sourcesreplaceregion, testId, serviceArn, testSourcesAdds 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_sourcesdeleteregionRemoves 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
serviceArnstringThe ARN of the service the test belongs to.
test_idstringThe identifier of the test to list sources for.
maxResultsinteger
nextTokenstring
typestringFilter sources by type.

SELECT examples

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

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

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
;