Skip to main content

sampling_rules

Creates, updates, deletes or gets a sampling_rule resource or lists sampling_rules in a region

Overview

Namesampling_rules
TypeResource
DescriptionThis schema provides construct and validation rules for AWS-XRay SamplingRule resource parameters.
Idaws.xray.sampling_rules

Fields

NameDatatypeDescription
sampling_ruleobjectThis schema provides construct and validation rules for AWS-XRay SamplingRule resource parameters.
sampling_rule_recordobject
sampling_rule_updateobject
rule_arnstringThe ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
rule_namestringThe ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all sampling_rules in a region.

SELECT
region,
sampling_rule,
sampling_rule_record,
sampling_rule_update,
rule_arn,
rule_name,
tags
FROM aws.xray.sampling_rules
WHERE region = 'us-east-1';

Gets all properties from an individual sampling_rule.

SELECT
region,
sampling_rule,
sampling_rule_record,
sampling_rule_update,
rule_arn,
rule_name,
tags
FROM aws.xray.sampling_rules
WHERE region = 'us-east-1' AND data__Identifier = '<RuleARN>';

INSERT example

Use the following StackQL query and manifest file to create a new sampling_rule resource, using stack-deploy.

/*+ create */
INSERT INTO aws.xray.sampling_rules (
SamplingRule,
SamplingRuleRecord,
SamplingRuleUpdate,
RuleName,
Tags,
region
)
SELECT
'{{ SamplingRule }}',
'{{ SamplingRuleRecord }}',
'{{ SamplingRuleUpdate }}',
'{{ RuleName }}',
'{{ Tags }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.xray.sampling_rules
WHERE data__Identifier = '<RuleARN>'
AND region = 'us-east-1';

Permissions

To operate on the sampling_rules resource, the following permissions are required:

Create

xray:CreateSamplingRule,
xray:TagResource

Read

xray:GetSamplingRules,
xray:ListTagsForResource

Update

xray:UpdateSamplingRule,
xray:TagResource,
xray:UntagResource,
xray:ListTagsForResource

Delete

xray:DeleteSamplingRule

List

xray:GetSamplingRules,
xray:ListTagsForResource