Skip to content

Resource: awsXraySamplingRule

Creates and manages an AWS XRay Sampling Rule.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.xraySamplingRule.XraySamplingRule(this, "example", {
  attributes: {
    Hello: "Tris",
  },
  fixedRate: 0.05,
  host: "*",
  httpMethod: "*",
  priority: 10000,
  reservoirSize: 1,
  resourceArn: "*",
  ruleName: "example",
  serviceName: "*",
  serviceType: "*",
  urlPath: "*",
  version: 1,
});

Argument Reference

  • ruleName - (Required) The name of the sampling rule.
  • resourceArn - (Required) Matches the ARN of the AWS resource on which the service runs.
  • priority - (Required) The priority of the sampling rule.
  • fixedRate - (Required) The percentage of matching requests to instrument, after the reservoir is exhausted.
  • reservoirSize - (Required) A fixed number of matching requests to instrument per second, prior to applying the fixed rate. The reservoir is not used directly by services, but applies to all services using the rule collectively.
  • serviceName - (Required) Matches the name that the service uses to identify itself in segments.
  • serviceType - (Required) Matches the origin that the service uses to identify its type in segments.
  • host - (Required) Matches the hostname from a request URL.
  • httpMethod - (Required) Matches the HTTP method of a request.
  • urlPath - (Required) Matches the path from a request URL.
  • version - (Required) The version of the sampling rule format (1 )
  • attributes - (Optional) Matches attributes derived from the request.
  • tags - (Optional) Key-value mapping of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The name of the sampling rule.
  • arn - The ARN of the sampling rule.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

XRay Sampling Rules can be imported using the name, e.g.,

$ terraform import aws_xray_sampling_rule.example example