SamplingRule

class SamplingRule : KotlinCustomResource

Creates and manages an AWS XRay Sampling Rule.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.xray.SamplingRule("example", {
ruleName: "example",
priority: 9999,
version: 1,
reservoirSize: 1,
fixedRate: 0.05,
urlPath: "*",
host: "*",
httpMethod: "*",
serviceType: "*",
serviceName: "*",
resourceArn: "*",
attributes: {
Hello: "Tris",
},
});
import pulumi
import pulumi_aws as aws
example = aws.xray.SamplingRule("example",
rule_name="example",
priority=9999,
version=1,
reservoir_size=1,
fixed_rate=0.05,
url_path="*",
host="*",
http_method="*",
service_type="*",
service_name="*",
resource_arn="*",
attributes={
"Hello": "Tris",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Xray.SamplingRule("example", new()
{
RuleName = "example",
Priority = 9999,
Version = 1,
ReservoirSize = 1,
FixedRate = 0.05,
UrlPath = "*",
Host = "*",
HttpMethod = "*",
ServiceType = "*",
ServiceName = "*",
ResourceArn = "*",
Attributes =
{
{ "Hello", "Tris" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/xray"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := xray.NewSamplingRule(ctx, "example", &xray.SamplingRuleArgs{
RuleName: pulumi.String("example"),
Priority: pulumi.Int(9999),
Version: pulumi.Int(1),
ReservoirSize: pulumi.Int(1),
FixedRate: pulumi.Float64(0.05),
UrlPath: pulumi.String("*"),
Host: pulumi.String("*"),
HttpMethod: pulumi.String("*"),
ServiceType: pulumi.String("*"),
ServiceName: pulumi.String("*"),
ResourceArn: pulumi.String("*"),
Attributes: pulumi.StringMap{
"Hello": pulumi.String("Tris"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.xray.SamplingRule;
import com.pulumi.aws.xray.SamplingRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new SamplingRule("example", SamplingRuleArgs.builder()
.ruleName("example")
.priority(9999)
.version(1)
.reservoirSize(1)
.fixedRate(0.05)
.urlPath("*")
.host("*")
.httpMethod("*")
.serviceType("*")
.serviceName("*")
.resourceArn("*")
.attributes(Map.of("Hello", "Tris"))
.build());
}
}
resources:
example:
type: aws:xray:SamplingRule
properties:
ruleName: example
priority: 9999
version: 1
reservoirSize: 1
fixedRate: 0.05
urlPath: '*'
host: '*'
httpMethod: '*'
serviceType: '*'
serviceName: '*'
resourceArn: '*'
attributes:
Hello: Tris

Import

Using pulumi import, import XRay Sampling Rules using the name. For example:

$ pulumi import aws:xray/samplingRule:SamplingRule example example

Properties

Link copied to clipboard
val arn: Output<String>

The ARN of the sampling rule.

Link copied to clipboard
val attributes: Output<Map<String, String>>?

Matches attributes derived from the request.

Link copied to clipboard
val fixedRate: Output<Double>

The percentage of matching requests to instrument, after the reservoir is exhausted.

Link copied to clipboard
val host: Output<String>

Matches the hostname from a request URL.

Link copied to clipboard
val httpMethod: Output<String>

Matches the HTTP method of a request.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val priority: Output<Int>

The priority of the sampling rule.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val reservoirSize: Output<Int>

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.

Link copied to clipboard
val resourceArn: Output<String>

Matches the ARN of the AWS resource on which the service runs.

Link copied to clipboard
val ruleName: Output<String>?

The name of the sampling rule.

Link copied to clipboard
val serviceName: Output<String>

Matches the name that the service uses to identify itself in segments.

Link copied to clipboard
val serviceType: Output<String>

Matches the origin that the service uses to identify its type in segments.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Key-value mapping of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard
val urlPath: Output<String>

Matches the path from a request URL.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<Int>

The version of the sampling rule format (1 )