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
new SamplingRule(name: string, args: SamplingRuleArgs, opts?: CustomResourceOptions);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)public SamplingRule(string name, SamplingRuleArgs args, CustomResourceOptions? opts = null)- 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:
- Fixed
Rate double The percentage of matching requests to instrument, after the reservoir is exhausted.
- Host string
Matches the hostname from a request URL.
- Http
Method string 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 string Matches the ARN of the AWS resource on which the service runs.
- Service
Name string Matches the
namethat the service uses to identify itself in segments.- Service
Type string Matches the
originthat the service uses to identify its type in segments.- Url
Path 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.
- Rule
Name string The name of the sampling rule.
- Fixed
Rate float64 The percentage of matching requests to instrument, after the reservoir is exhausted.
- Host string
Matches the hostname from a request URL.
- Http
Method string 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 string Matches the ARN of the AWS resource on which the service runs.
- Service
Name string Matches the
namethat the service uses to identify itself in segments.- Service
Type string Matches the
originthat the service uses to identify its type in segments.- Url
Path 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.
- Rule
Name string The name of the sampling rule.
- fixed
Rate number The percentage of matching requests to instrument, after the reservoir is exhausted.
- host string
Matches the hostname from a request URL.
- http
Method string Matches the HTTP method of a request.
- priority number
The priority of the sampling rule.
- reservoir
Size 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.
- resource
Arn string Matches the ARN of the AWS resource on which the service runs.
- service
Name string Matches the
namethat the service uses to identify itself in segments.- service
Type string Matches the
originthat the service uses to identify its type in segments.- url
Path 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.
- rule
Name 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
namethat the service uses to identify itself in segments.- service_
type str Matches the
originthat 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:
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): SamplingRulestatic 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.
- Fixed
Rate double The percentage of matching requests to instrument, after the reservoir is exhausted.
- Host string
Matches the hostname from a request URL.
- Http
Method string 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 string Matches the ARN of the AWS resource on which the service runs.
- Rule
Name string The name of the sampling rule.
- Service
Name string Matches the
namethat the service uses to identify itself in segments.- Service
Type string Matches the
originthat the service uses to identify its type in segments.- Url
Path 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.
- Fixed
Rate float64 The percentage of matching requests to instrument, after the reservoir is exhausted.
- Host string
Matches the hostname from a request URL.
- Http
Method string 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 string Matches the ARN of the AWS resource on which the service runs.
- Rule
Name string The name of the sampling rule.
- Service
Name string Matches the
namethat the service uses to identify itself in segments.- Service
Type string Matches the
originthat the service uses to identify its type in segments.- Url
Path 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.
- fixed
Rate number The percentage of matching requests to instrument, after the reservoir is exhausted.
- host string
Matches the hostname from a request URL.
- http
Method string Matches the HTTP method of a request.
- priority number
The priority of the sampling rule.
- reservoir
Size 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.
- resource
Arn string Matches the ARN of the AWS resource on which the service runs.
- rule
Name string The name of the sampling rule.
- service
Name string Matches the
namethat the service uses to identify itself in segments.- service
Type string Matches the
originthat the service uses to identify its type in segments.- url
Path 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
namethat the service uses to identify itself in segments.- service_
type str Matches the
originthat 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
awsTerraform Provider.