Try AWS Native preview for resources not in the classic version.
aws.xray.SamplingRule
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
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",
})
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
})
}
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 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
Create SamplingRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SamplingRule(name: string, args: SamplingRuleArgs, opts?: CustomResourceOptions);
@overload
def SamplingRule(resource_name: str,
args: SamplingRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SamplingRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_arn: Optional[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,
service_name: Optional[str] = None,
service_type: Optional[str] = None,
url_path: Optional[str] = None,
version: Optional[int] = None,
attributes: Optional[Mapping[str, str]] = None,
rule_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var samplingRuleResource = new Aws.Xray.SamplingRule("samplingRuleResource", new()
{
ResourceArn = "string",
FixedRate = 0,
Host = "string",
HttpMethod = "string",
Priority = 0,
ReservoirSize = 0,
ServiceName = "string",
ServiceType = "string",
UrlPath = "string",
Version = 0,
Attributes =
{
{ "string", "string" },
},
RuleName = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := xray.NewSamplingRule(ctx, "samplingRuleResource", &xray.SamplingRuleArgs{
ResourceArn: pulumi.String("string"),
FixedRate: pulumi.Float64(0),
Host: pulumi.String("string"),
HttpMethod: pulumi.String("string"),
Priority: pulumi.Int(0),
ReservoirSize: pulumi.Int(0),
ServiceName: pulumi.String("string"),
ServiceType: pulumi.String("string"),
UrlPath: pulumi.String("string"),
Version: pulumi.Int(0),
Attributes: pulumi.StringMap{
"string": pulumi.String("string"),
},
RuleName: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var samplingRuleResource = new SamplingRule("samplingRuleResource", SamplingRuleArgs.builder()
.resourceArn("string")
.fixedRate(0)
.host("string")
.httpMethod("string")
.priority(0)
.reservoirSize(0)
.serviceName("string")
.serviceType("string")
.urlPath("string")
.version(0)
.attributes(Map.of("string", "string"))
.ruleName("string")
.tags(Map.of("string", "string"))
.build());
sampling_rule_resource = aws.xray.SamplingRule("samplingRuleResource",
resource_arn="string",
fixed_rate=0,
host="string",
http_method="string",
priority=0,
reservoir_size=0,
service_name="string",
service_type="string",
url_path="string",
version=0,
attributes={
"string": "string",
},
rule_name="string",
tags={
"string": "string",
})
const samplingRuleResource = new aws.xray.SamplingRule("samplingRuleResource", {
resourceArn: "string",
fixedRate: 0,
host: "string",
httpMethod: "string",
priority: 0,
reservoirSize: 0,
serviceName: "string",
serviceType: "string",
urlPath: "string",
version: 0,
attributes: {
string: "string",
},
ruleName: "string",
tags: {
string: "string",
},
});
type: aws:xray:SamplingRule
properties:
attributes:
string: string
fixedRate: 0
host: string
httpMethod: string
priority: 0
reservoirSize: 0
resourceArn: string
ruleName: string
serviceName: string
serviceType: string
tags:
string: string
urlPath: string
version: 0
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:
- 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
name
that the service uses to identify itself in segments. - Service
Type string - Matches the
origin
that 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.
- 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
- 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
name
that the service uses to identify itself in segments. - Service
Type string - Matches the
origin
that 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.
- 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
- 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 Integer
- The priority of the sampling rule.
- reservoir
Size 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.
- resource
Arn String - Matches the ARN of the AWS resource on which the service runs.
- service
Name String - Matches the
name
that the service uses to identify itself in segments. - service
Type String - Matches the
origin
that the service uses to identify its type in segments. - url
Path 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.
- rule
Name String - The name of the sampling rule.
- 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
- 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
name
that the service uses to identify itself in segments. - service
Type string - Matches the
origin
that 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.
- {[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.
- 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
- 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
name
that the service uses to identify itself in segments. - service
Type String - Matches the
origin
that 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 Map<String>
- Matches attributes derived from the request.
- rule
Name String - The name of the sampling rule.
- 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:
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.
- 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
name
that the service uses to identify itself in segments. - Service
Type string - Matches the
origin
that the service uses to identify its type in segments. - 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 - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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
name
that the service uses to identify itself in segments. - Service
Type string - Matches the
origin
that the service uses to identify its type in segments. - 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 - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 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 Integer
- The priority of the sampling rule.
- reservoir
Size 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.
- 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
name
that the service uses to identify itself in segments. - service
Type String - Matches the
origin
that the service uses to identify its type in segments. - 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 - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - url
Path 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.
- 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
name
that the service uses to identify itself in segments. - service
Type string - Matches the
origin
that the service uses to identify its type in segments. - {[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 - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - 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 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. - 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 - 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.
- 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
name
that the service uses to identify itself in segments. - service
Type String - Matches the
origin
that the service uses to identify its type in segments. - 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 - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block. - url
Path String - Matches the path from a request URL.
- version Number
- The version of the sampling rule format (
1
)
Import
Using pulumi import
, import XRay Sampling Rules using the name. For example:
$ pulumi import aws:xray/samplingRule:SamplingRule example example
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.