aws logo
AWS Classic v5.29.0, Feb 1 23

aws.xray.SamplingRule

Creates and manages an AWS XRay Sampling Rule.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Xray.SamplingRule("example", new()
    {
        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/v5/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{
			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
	})
}
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()        
            .attributes(Map.of("Hello", "Tris"))
            .fixedRate(0.05)
            .host("*")
            .httpMethod("*")
            .priority(10000)
            .reservoirSize(1)
            .resourceArn("*")
            .ruleName("example")
            .serviceName("*")
            .serviceType("*")
            .urlPath("*")
            .version(1)
            .build());

    }
}
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,
});
resources:
  example:
    type: aws:xray:SamplingRule
    properties:
      attributes:
        Hello: Tris
      fixedRate: 0.05
      host: '*'
      httpMethod: '*'
      priority: 10000
      reservoirSize: 1
      resourceArn: '*'
      ruleName: example
      serviceName: '*'
      serviceType: '*'
      urlPath: '*'
      version: 1

Create SamplingRule Resource

new SamplingRule(name: string, args: SamplingRuleArgs, opts?: CustomResourceOptions);
@overload
def SamplingRule(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 attributes: Optional[Mapping[str, str]] = None,
                 fixed_rate: Optional[float] = None,
                 host: Optional[str] = None,
                 http_method: Optional[str] = None,
                 priority: Optional[int] = None,
                 reservoir_size: Optional[int] = None,
                 resource_arn: Optional[str] = None,
                 rule_name: Optional[str] = None,
                 service_name: Optional[str] = None,
                 service_type: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 url_path: Optional[str] = None,
                 version: Optional[int] = None)
@overload
def SamplingRule(resource_name: str,
                 args: SamplingRuleArgs,
                 opts: Optional[ResourceOptions] = None)
func NewSamplingRule(ctx *Context, name string, args SamplingRuleArgs, opts ...ResourceOption) (*SamplingRule, error)
public SamplingRule(string name, SamplingRuleArgs args, CustomResourceOptions? opts = null)
public SamplingRule(String name, SamplingRuleArgs args)
public SamplingRule(String name, SamplingRuleArgs args, CustomResourceOptions options)
type: aws:xray:SamplingRule
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args SamplingRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control 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.
name String
The unique name of the resource.
args SamplingRuleArgs
The arguments to resource properties.
options 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 Architecture and Concepts 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.

Tags Dictionary<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

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.

Tags 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

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 Integer

The priority of the sampling rule.

reservoirSize Integer

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 Integer

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.

tags 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

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.

tags {[key: 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

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 int

The priority of the sampling rule.

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

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 int

The version of the sampling rule format (1 )

attributes Mapping[str, str]

Matches attributes derived from the request.

rule_name str

The name of the sampling rule.

tags Mapping[str, str]

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

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 Map<String>

Matches attributes derived from the request.

ruleName String

The name of the sampling rule.

tags Map<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

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.

TagsAll Dictionary<string, string>

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

Arn string

The ARN of the sampling rule.

Id string

The provider-assigned unique ID for this managed resource.

TagsAll map[string]string

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

arn String

The ARN of the sampling rule.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String,String>

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

arn string

The ARN of the sampling rule.

id string

The provider-assigned unique ID for this managed resource.

tagsAll {[key: string]: string}

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

arn str

The ARN of the sampling rule.

id str

The provider-assigned unique ID for this managed resource.

tags_all Mapping[str, str]

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

arn String

The ARN of the sampling rule.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String>

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

Look up 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
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        attributes: Optional[Mapping[str, str]] = None,
        fixed_rate: Optional[float] = None,
        host: Optional[str] = None,
        http_method: Optional[str] = None,
        priority: Optional[int] = None,
        reservoir_size: Optional[int] = None,
        resource_arn: Optional[str] = None,
        rule_name: Optional[str] = None,
        service_name: Optional[str] = None,
        service_type: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        url_path: Optional[str] = None,
        version: Optional[int] = None) -> SamplingRule
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)
public static SamplingRule get(String name, Output<String> id, SamplingRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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.

Tags Dictionary<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

TagsAll Dictionary<string, string>

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

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.

Tags 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

TagsAll map[string]string

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

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 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 Integer

The priority of the sampling rule.

reservoirSize Integer

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.

tags 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

tagsAll Map<String,String>

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

urlPath String

Matches the path from a request URL.

version Integer

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.

tags {[key: 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

tagsAll {[key: string]: string}

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

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 Mapping[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 int

The priority of the sampling rule.

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

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.

tags Mapping[str, str]

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

tags_all Mapping[str, str]

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

url_path str

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>

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.

tags Map<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

tagsAll Map<String>

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

urlPath String

Matches the path from a request URL.

version Number

The version of the sampling rule format (1 )

Import

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

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

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.