sampling_rules
Creates, updates, deletes or gets a sampling_rule
resource or lists sampling_rules
in a region
Overview
Name | sampling_rules |
Type | Resource |
Description | This schema provides construct and validation rules for AWS-XRay SamplingRule resource parameters. |
Id | aws.xray.sampling_rules |
Fields
Name | Datatype | Description |
---|---|---|
sampling_rule | object | This schema provides construct and validation rules for AWS-XRay SamplingRule resource parameters. |
sampling_rule_record | object | |
sampling_rule_update | object | |
rule_arn | string | The ARN of the sampling rule. Specify a rule by either name or ARN, but not both. |
rule_name | string | The ARN of the sampling rule. Specify a rule by either name or ARN, but not both. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.xray.sampling_rules (
SamplingRule,
SamplingRuleRecord,
SamplingRuleUpdate,
RuleName,
Tags,
region
)
SELECT
'{{ SamplingRule }}',
'{{ SamplingRuleRecord }}',
'{{ SamplingRuleUpdate }}',
'{{ RuleName }}',
'{{ Tags }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.xray.sampling_rules (
SamplingRule,
SamplingRuleRecord,
SamplingRuleUpdate,
RuleName,
Tags,
region
)
SELECT
'{{ SamplingRule }}',
'{{ SamplingRuleRecord }}',
'{{ SamplingRuleUpdate }}',
'{{ RuleName }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: sampling_rule
props:
- name: SamplingRule
value:
SamplingRule: null
SamplingRuleRecord:
CreatedAt: '{{ CreatedAt }}'
ModifiedAt: '{{ ModifiedAt }}'
SamplingRule: null
SamplingRuleUpdate:
Attributes: {}
FixedRate: null
Host: '{{ Host }}'
HTTPMethod: '{{ HTTPMethod }}'
Priority: '{{ Priority }}'
ReservoirSize: '{{ ReservoirSize }}'
ResourceARN: '{{ ResourceARN }}'
RuleARN: '{{ RuleARN }}'
RuleName: '{{ RuleName }}'
ServiceName: '{{ ServiceName }}'
ServiceType: '{{ ServiceType }}'
URLPath: '{{ URLPath }}'
RuleName: null
Tags:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: SamplingRuleRecord
value: null
- name: SamplingRuleUpdate
value: null
- name: RuleName
value: null
- name: Tags
value: null
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