SamplingRule

Creates and manages an AWS XRay Sampling Rule.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Xray.SamplingRule("example", new Aws.Xray.SamplingRuleArgs
        {
            Attributes = 
            {
                { "Hello", "Tris" },
            },
            FixedRate = 0.05,
            Host = "*",
            HttpMethod = "*",
            Priority = 10000,
            ReservoirSize = 1,
            ResourceArn = "*",
            RuleName = "example",
            ServiceName = "*",
            ServiceType = "*",
            UrlPath = "*",
            Version = 1,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/xray"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := xray.NewSamplingRule(ctx, "example", &xray.SamplingRuleArgs{
            Attributes: pulumi.StringMap{
                "Hello": pulumi.String("Tris"),
            },
            FixedRate:     pulumi.Float64(0.05),
            Host:          pulumi.String("*"),
            HttpMethod:    pulumi.String("*"),
            Priority:      pulumi.Int(10000),
            ReservoirSize: pulumi.Int(1),
            ResourceArn:   pulumi.String("*"),
            RuleName:      pulumi.String("example"),
            ServiceName:   pulumi.String("*"),
            ServiceType:   pulumi.String("*"),
            UrlPath:       pulumi.String("*"),
            Version:       pulumi.Int(1),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.xray.SamplingRule("example",
    attributes={
        "Hello": "Tris",
    },
    fixed_rate=0.05,
    host="*",
    http_method="*",
    priority=10000,
    reservoir_size=1,
    resource_arn="*",
    rule_name="example",
    service_name="*",
    service_type="*",
    url_path="*",
    version=1)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.xray.SamplingRule("example", {
    attributes: {
        Hello: "Tris",
    },
    fixedRate: 0.05,
    host: "*",
    httpMethod: "*",
    priority: 10000,
    reservoirSize: 1,
    resourceArn: "*",
    ruleName: "example",
    serviceName: "*",
    serviceType: "*",
    urlPath: "*",
    version: 1,
});

Create a SamplingRule Resource

def SamplingRule(resource_name, opts=None, attributes=None, fixed_rate=None, host=None, http_method=None, priority=None, reservoir_size=None, resource_arn=None, rule_name=None, service_name=None, service_type=None, url_path=None, version=None, __props__=None);
func NewSamplingRule(ctx *Context, name string, args SamplingRuleArgs, opts ...ResourceOption) (*SamplingRule, error)
name string
The unique name of the resource.
args SamplingRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SamplingRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SamplingRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

SamplingRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The SamplingRule resource accepts the following input properties:

FixedRate double

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

Host string

Matches the hostname from a request URL.

HttpMethod string

Matches the HTTP method of a request.

Priority int

The priority of the sampling rule.

ReservoirSize 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.

ResourceArn string

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

ServiceName string

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

ServiceType string

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

UrlPath string

Matches the path from a request URL.

Version int

The version of the sampling rule format (1 )

Attributes Dictionary<string, string>

Matches attributes derived from the request.

RuleName string

The name of the sampling rule.

FixedRate float64

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

Host string

Matches the hostname from a request URL.

HttpMethod string

Matches the HTTP method of a request.

Priority int

The priority of the sampling rule.

ReservoirSize 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.

ResourceArn string

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

ServiceName string

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

ServiceType string

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

UrlPath string

Matches the path from a request URL.

Version int

The version of the sampling rule format (1 )

Attributes map[string]string

Matches attributes derived from the request.

RuleName string

The name of the sampling rule.

fixedRate number

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

host string

Matches the hostname from a request URL.

httpMethod string

Matches the HTTP method of a request.

priority number

The priority of the sampling rule.

reservoirSize number

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.

resourceArn string

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

serviceName string

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

serviceType string

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

urlPath string

Matches the path from a request URL.

version number

The version of the sampling rule format (1 )

attributes {[key: string]: string}

Matches attributes derived from the request.

ruleName string

The name of the sampling rule.

fixed_rate float

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

host str

Matches the hostname from a request URL.

http_method str

Matches the HTTP method of a request.

priority float

The priority of the sampling rule.

reservoir_size float

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.

resource_arn str

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

service_name str

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

service_type str

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

url_path str

Matches the path from a request URL.

version float

The version of the sampling rule format (1 )

attributes Dict[str, str]

Matches attributes derived from the request.

rule_name str

The name of the sampling rule.

Outputs

All input properties are implicitly available as output properties. Additionally, the SamplingRule resource produces the following output properties:

Arn string

The ARN of the sampling rule.

Id string
The provider-assigned unique ID for this managed resource.
Arn string

The ARN of the sampling rule.

Id string
The provider-assigned unique ID for this managed resource.
arn string

The ARN of the sampling rule.

id string
The provider-assigned unique ID for this managed resource.
arn str

The ARN of the sampling rule.

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing SamplingRule Resource

Get an existing SamplingRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SamplingRuleState, opts?: CustomResourceOptions): SamplingRule
static get(resource_name, id, opts=None, arn=None, attributes=None, fixed_rate=None, host=None, http_method=None, priority=None, reservoir_size=None, resource_arn=None, rule_name=None, service_name=None, service_type=None, url_path=None, version=None, __props__=None);
func GetSamplingRule(ctx *Context, name string, id IDInput, state *SamplingRuleState, opts ...ResourceOption) (*SamplingRule, error)
public static SamplingRule Get(string name, Input<string> id, SamplingRuleState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string

The ARN of the sampling rule.

Attributes Dictionary<string, string>

Matches attributes derived from the request.

FixedRate double

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

Host string

Matches the hostname from a request URL.

HttpMethod string

Matches the HTTP method of a request.

Priority int

The priority of the sampling rule.

ReservoirSize 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.

ResourceArn string

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

RuleName string

The name of the sampling rule.

ServiceName string

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

ServiceType string

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

UrlPath string

Matches the path from a request URL.

Version int

The version of the sampling rule format (1 )

Arn string

The ARN of the sampling rule.

Attributes map[string]string

Matches attributes derived from the request.

FixedRate float64

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

Host string

Matches the hostname from a request URL.

HttpMethod string

Matches the HTTP method of a request.

Priority int

The priority of the sampling rule.

ReservoirSize 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.

ResourceArn string

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

RuleName string

The name of the sampling rule.

ServiceName string

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

ServiceType string

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

UrlPath string

Matches the path from a request URL.

Version int

The version of the sampling rule format (1 )

arn string

The ARN of the sampling rule.

attributes {[key: string]: string}

Matches attributes derived from the request.

fixedRate number

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

host string

Matches the hostname from a request URL.

httpMethod string

Matches the HTTP method of a request.

priority number

The priority of the sampling rule.

reservoirSize number

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.

resourceArn string

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

ruleName string

The name of the sampling rule.

serviceName string

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

serviceType string

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

urlPath string

Matches the path from a request URL.

version number

The version of the sampling rule format (1 )

arn str

The ARN of the sampling rule.

attributes Dict[str, str]

Matches attributes derived from the request.

fixed_rate float

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

host str

Matches the hostname from a request URL.

http_method str

Matches the HTTP method of a request.

priority float

The priority of the sampling rule.

reservoir_size float

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.

resource_arn str

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

rule_name str

The name of the sampling rule.

service_name str

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

service_type str

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

url_path str

Matches the path from a request URL.

version float

The version of the sampling rule format (1 )

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.