published on Friday, May 29, 2026 by Pulumi
published on Friday, May 29, 2026 by Pulumi
Manages an AWS X-Ray indexing rule.
Note: Removing this resource from Terraform has no effect on the indedxing rule within AWS X-Ray.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.xray.IndexingRule("example", {
name: "Default",
rule: {
probabilistic: {
desiredSamplingPercentage: 0.66,
},
},
});
import pulumi
import pulumi_aws as aws
example = aws.xray.IndexingRule("example",
name="Default",
rule={
"probabilistic": {
"desired_sampling_percentage": 0.66,
},
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/xray"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := xray.NewIndexingRule(ctx, "example", &xray.IndexingRuleArgs{
Name: pulumi.String("Default"),
Rule: &xray.IndexingRuleRuleArgs{
Probabilistic: &xray.IndexingRuleRuleProbabilisticArgs{
DesiredSamplingPercentage: pulumi.Float64(0.66),
},
},
})
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.IndexingRule("example", new()
{
Name = "Default",
Rule = new Aws.Xray.Inputs.IndexingRuleRuleArgs
{
Probabilistic = new Aws.Xray.Inputs.IndexingRuleRuleProbabilisticArgs
{
DesiredSamplingPercentage = 0.66,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.xray.IndexingRule;
import com.pulumi.aws.xray.IndexingRuleArgs;
import com.pulumi.aws.xray.inputs.IndexingRuleRuleArgs;
import com.pulumi.aws.xray.inputs.IndexingRuleRuleProbabilisticArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 IndexingRule("example", IndexingRuleArgs.builder()
.name("Default")
.rule(IndexingRuleRuleArgs.builder()
.probabilistic(IndexingRuleRuleProbabilisticArgs.builder()
.desiredSamplingPercentage(0.66)
.build())
.build())
.build());
}
}
resources:
example:
type: aws:xray:IndexingRule
properties:
name: Default
rule:
probabilistic:
desiredSamplingPercentage: 0.66
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_xray_indexingrule" "example" {
name = "Default"
rule = {
probabilistic = {
desired_sampling_percentage = 0.66
}
}
}
Create IndexingRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IndexingRule(name: string, args: IndexingRuleArgs, opts?: CustomResourceOptions);@overload
def IndexingRule(resource_name: str,
args: IndexingRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IndexingRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
rule: Optional[IndexingRuleRuleArgs] = None,
name: Optional[str] = None,
region: Optional[str] = None)func NewIndexingRule(ctx *Context, name string, args IndexingRuleArgs, opts ...ResourceOption) (*IndexingRule, error)public IndexingRule(string name, IndexingRuleArgs args, CustomResourceOptions? opts = null)
public IndexingRule(String name, IndexingRuleArgs args)
public IndexingRule(String name, IndexingRuleArgs args, CustomResourceOptions options)
type: aws:xray:IndexingRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "aws_xray_indexingrule" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args IndexingRuleArgs
- 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 IndexingRuleArgs
- 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 IndexingRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IndexingRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IndexingRuleArgs
- 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 indexingRuleResource = new Aws.Xray.IndexingRule("indexingRuleResource", new()
{
Rule = new Aws.Xray.Inputs.IndexingRuleRuleArgs
{
Probabilistic = new Aws.Xray.Inputs.IndexingRuleRuleProbabilisticArgs
{
DesiredSamplingPercentage = 0,
ActualSamplingPercentage = 0,
},
},
Name = "string",
Region = "string",
});
example, err := xray.NewIndexingRule(ctx, "indexingRuleResource", &xray.IndexingRuleArgs{
Rule: &xray.IndexingRuleRuleArgs{
Probabilistic: &xray.IndexingRuleRuleProbabilisticArgs{
DesiredSamplingPercentage: pulumi.Float64(0),
ActualSamplingPercentage: pulumi.Float64(0),
},
},
Name: pulumi.String("string"),
Region: pulumi.String("string"),
})
resource "aws_xray_indexingrule" "indexingRuleResource" {
rule = {
probabilistic = {
desired_sampling_percentage = 0
actual_sampling_percentage = 0
}
}
name = "string"
region = "string"
}
var indexingRuleResource = new IndexingRule("indexingRuleResource", IndexingRuleArgs.builder()
.rule(IndexingRuleRuleArgs.builder()
.probabilistic(IndexingRuleRuleProbabilisticArgs.builder()
.desiredSamplingPercentage(0.0)
.actualSamplingPercentage(0.0)
.build())
.build())
.name("string")
.region("string")
.build());
indexing_rule_resource = aws.xray.IndexingRule("indexingRuleResource",
rule={
"probabilistic": {
"desired_sampling_percentage": float(0),
"actual_sampling_percentage": float(0),
},
},
name="string",
region="string")
const indexingRuleResource = new aws.xray.IndexingRule("indexingRuleResource", {
rule: {
probabilistic: {
desiredSamplingPercentage: 0,
actualSamplingPercentage: 0,
},
},
name: "string",
region: "string",
});
type: aws:xray:IndexingRule
properties:
name: string
region: string
rule:
probabilistic:
actualSamplingPercentage: 0
desiredSamplingPercentage: 0
IndexingRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IndexingRule resource accepts the following input properties:
- Rule
Indexing
Rule Rule - Rule configuration. See
ruleBlock below. - Name string
- Indexing rule name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Rule
Indexing
Rule Rule Args - Rule configuration. See
ruleBlock below. - Name string
- Indexing rule name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Indexing
Rule Rule - Rule configuration. See
ruleBlock below. - name String
- Indexing rule name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Indexing
Rule Rule - Rule configuration. See
ruleBlock below. - name string
- Indexing rule name.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Indexing
Rule Rule Args - Rule configuration. See
ruleBlock below. - name str
- Indexing rule name.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule Property Map
- Rule configuration. See
ruleBlock below. - name String
- Indexing rule name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
Outputs
All input properties are implicitly available as output properties. Additionally, the IndexingRule resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing IndexingRule Resource
Get an existing IndexingRule 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?: IndexingRuleState, opts?: CustomResourceOptions): IndexingRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
region: Optional[str] = None,
rule: Optional[IndexingRuleRuleArgs] = None) -> IndexingRulefunc GetIndexingRule(ctx *Context, name string, id IDInput, state *IndexingRuleState, opts ...ResourceOption) (*IndexingRule, error)public static IndexingRule Get(string name, Input<string> id, IndexingRuleState? state, CustomResourceOptions? opts = null)public static IndexingRule get(String name, Output<String> id, IndexingRuleState state, CustomResourceOptions options)resources: _: type: aws:xray:IndexingRule get: id: ${id}import {
to = aws_xray_indexingrule.example
id = "${id}"
}
- 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.
- Name string
- Indexing rule name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Rule
Indexing
Rule Rule - Rule configuration. See
ruleBlock below.
- Name string
- Indexing rule name.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Rule
Indexing
Rule Rule Args - Rule configuration. See
ruleBlock below.
- name String
- Indexing rule name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Indexing
Rule Rule - Rule configuration. See
ruleBlock below.
- name string
- Indexing rule name.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Indexing
Rule Rule - Rule configuration. See
ruleBlock below.
- name str
- Indexing rule name.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule
Indexing
Rule Rule Args - Rule configuration. See
ruleBlock below.
- name String
- Indexing rule name.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- rule Property Map
- Rule configuration. See
ruleBlock below.
Supporting Types
IndexingRuleRule, IndexingRuleRuleArgs
- Probabilistic
Indexing
Rule Rule Probabilistic - Indexing rule configuration used to probabilistically sample traceIds. See
probabilisticBlock below.
- Probabilistic
Indexing
Rule Rule Probabilistic - Indexing rule configuration used to probabilistically sample traceIds. See
probabilisticBlock below.
- probabilistic object
- Indexing rule configuration used to probabilistically sample traceIds. See
probabilisticBlock below.
- probabilistic
Indexing
Rule Rule Probabilistic - Indexing rule configuration used to probabilistically sample traceIds. See
probabilisticBlock below.
- probabilistic
Indexing
Rule Rule Probabilistic - Indexing rule configuration used to probabilistically sample traceIds. See
probabilisticBlock below.
- probabilistic
Indexing
Rule Rule Probabilistic - Indexing rule configuration used to probabilistically sample traceIds. See
probabilisticBlock below.
- probabilistic Property Map
- Indexing rule configuration used to probabilistically sample traceIds. See
probabilisticBlock below.
IndexingRuleRuleProbabilistic, IndexingRuleRuleProbabilisticArgs
- Desired
Sampling doublePercentage - Configured sampling percentage of traceIds.
- Actual
Sampling doublePercentage - Applied sampling percentage of traceIds.
- Desired
Sampling float64Percentage - Configured sampling percentage of traceIds.
- Actual
Sampling float64Percentage - Applied sampling percentage of traceIds.
- desired_
sampling_ numberpercentage - Configured sampling percentage of traceIds.
- actual_
sampling_ numberpercentage - Applied sampling percentage of traceIds.
- desired
Sampling DoublePercentage - Configured sampling percentage of traceIds.
- actual
Sampling DoublePercentage - Applied sampling percentage of traceIds.
- desired
Sampling numberPercentage - Configured sampling percentage of traceIds.
- actual
Sampling numberPercentage - Applied sampling percentage of traceIds.
- desired_
sampling_ floatpercentage - Configured sampling percentage of traceIds.
- actual_
sampling_ floatpercentage - Applied sampling percentage of traceIds.
- desired
Sampling NumberPercentage - Configured sampling percentage of traceIds.
- actual
Sampling NumberPercentage - Applied sampling percentage of traceIds.
Import
Identity Schema
Required
name(String) Indexing rule name.
Optional
accountId(String) AWS Account where this resource is managed.region(String) Region where this resource is managed.
Using pulumi import, import XRay Indexing Rules using name. For example:
$ pulumi import aws:xray/indexingRule:IndexingRule example Default
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
awsTerraform Provider.
published on Friday, May 29, 2026 by Pulumi