Skip to content
v2.277.0

CfnSamplingRuleProps Struct ​

Properties for defining a CfnSamplingRule.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_xray as xray } from 'aws-cdk-lib';
const cfnSamplingRuleProps: xray.CfnSamplingRuleProps = {
  ruleName: 'ruleName',
  samplingRule: {
    fixedRate: 123,
    host: 'host',
    httpMethod: 'httpMethod',
    priority: 123,
    reservoirSize: 123,
    resourceArn: 'resourceArn',
    serviceName: 'serviceName',
    serviceType: 'serviceType',
    urlPath: 'urlPath',

    // the properties below are optional
    attributes: {
      attributesKey: 'attributes',
    },
    ruleArn: 'ruleArn',
    ruleName: 'ruleName',
    samplingRateBoost: {
      cooldownWindowMinutes: 123,
      maxRate: 123,
    },
    version: 123,
  },
  samplingRuleRecord: {
    createdAt: 'createdAt',
    modifiedAt: 'modifiedAt',
    samplingRule: {
      fixedRate: 123,
      host: 'host',
      httpMethod: 'httpMethod',
      priority: 123,
      reservoirSize: 123,
      resourceArn: 'resourceArn',
      serviceName: 'serviceName',
      serviceType: 'serviceType',
      urlPath: 'urlPath',

      // the properties below are optional
      attributes: {
        attributesKey: 'attributes',
      },
      ruleArn: 'ruleArn',
      ruleName: 'ruleName',
      samplingRateBoost: {
        cooldownWindowMinutes: 123,
        maxRate: 123,
      },
      version: 123,
    },
  },
  samplingRuleUpdate: {
    attributes: {
      attributesKey: 'attributes',
    },
    fixedRate: 123,
    host: 'host',
    httpMethod: 'httpMethod',
    priority: 123,
    reservoirSize: 123,
    resourceArn: 'resourceArn',
    ruleArn: 'ruleArn',
    ruleName: 'ruleName',
    samplingRateBoost: {
      cooldownWindowMinutes: 123,
      maxRate: 123,
    },
    serviceName: 'serviceName',
    serviceType: 'serviceType',
    urlPath: 'urlPath',
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_xray as xray

cfn_sampling_rule_props = xray.CfnSamplingRuleProps(
    rule_name="ruleName",
    sampling_rule=xray.CfnSamplingRule.SamplingRuleProperty(
        fixed_rate=123,
        host="host",
        http_method="httpMethod",
        priority=123,
        reservoir_size=123,
        resource_arn="resourceArn",
        service_name="serviceName",
        service_type="serviceType",
        url_path="urlPath",

        # the properties below are optional
        attributes={
            "attributes_key": "attributes"
        },
        rule_arn="ruleArn",
        rule_name="ruleName",
        sampling_rate_boost=xray.CfnSamplingRule.SamplingRateBoostProperty(
            cooldown_window_minutes=123,
            max_rate=123
        ),
        version=123
    ),
    sampling_rule_record=xray.CfnSamplingRule.SamplingRuleRecordProperty(
        created_at="createdAt",
        modified_at="modifiedAt",
        sampling_rule=xray.CfnSamplingRule.SamplingRuleProperty(
            fixed_rate=123,
            host="host",
            http_method="httpMethod",
            priority=123,
            reservoir_size=123,
            resource_arn="resourceArn",
            service_name="serviceName",
            service_type="serviceType",
            url_path="urlPath",

            # the properties below are optional
            attributes={
                "attributes_key": "attributes"
            },
            rule_arn="ruleArn",
            rule_name="ruleName",
            sampling_rate_boost=xray.CfnSamplingRule.SamplingRateBoostProperty(
                cooldown_window_minutes=123,
                max_rate=123
            ),
            version=123
        )
    ),
    sampling_rule_update=xray.CfnSamplingRule.SamplingRuleUpdateProperty(
        attributes={
            "attributes_key": "attributes"
        },
        fixed_rate=123,
        host="host",
        http_method="httpMethod",
        priority=123,
        reservoir_size=123,
        resource_arn="resourceArn",
        rule_arn="ruleArn",
        rule_name="ruleName",
        sampling_rate_boost=xray.CfnSamplingRule.SamplingRateBoostProperty(
            cooldown_window_minutes=123,
            max_rate=123
        ),
        service_name="serviceName",
        service_type="serviceType",
        url_path="urlPath"
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.xray.*;

CfnSamplingRuleProps cfnSamplingRuleProps = CfnSamplingRuleProps.builder()
        .ruleName("ruleName")
        .samplingRule(SamplingRuleProperty.builder()
                .fixedRate(123)
                .host("host")
                .httpMethod("httpMethod")
                .priority(123)
                .reservoirSize(123)
                .resourceArn("resourceArn")
                .serviceName("serviceName")
                .serviceType("serviceType")
                .urlPath("urlPath")

                // the properties below are optional
                .attributes(Map.of(
                        "attributesKey", "attributes"))
                .ruleArn("ruleArn")
                .ruleName("ruleName")
                .samplingRateBoost(SamplingRateBoostProperty.builder()
                        .cooldownWindowMinutes(123)
                        .maxRate(123)
                        .build())
                .version(123)
                .build())
        .samplingRuleRecord(SamplingRuleRecordProperty.builder()
                .createdAt("createdAt")
                .modifiedAt("modifiedAt")
                .samplingRule(SamplingRuleProperty.builder()
                        .fixedRate(123)
                        .host("host")
                        .httpMethod("httpMethod")
                        .priority(123)
                        .reservoirSize(123)
                        .resourceArn("resourceArn")
                        .serviceName("serviceName")
                        .serviceType("serviceType")
                        .urlPath("urlPath")

                        // the properties below are optional
                        .attributes(Map.of(
                                "attributesKey", "attributes"))
                        .ruleArn("ruleArn")
                        .ruleName("ruleName")
                        .samplingRateBoost(SamplingRateBoostProperty.builder()
                                .cooldownWindowMinutes(123)
                                .maxRate(123)
                                .build())
                        .version(123)
                        .build())
                .build())
        .samplingRuleUpdate(SamplingRuleUpdateProperty.builder()
                .attributes(Map.of(
                        "attributesKey", "attributes"))
                .fixedRate(123)
                .host("host")
                .httpMethod("httpMethod")
                .priority(123)
                .reservoirSize(123)
                .resourceArn("resourceArn")
                .ruleArn("ruleArn")
                .ruleName("ruleName")
                .samplingRateBoost(SamplingRateBoostProperty.builder()
                        .cooldownWindowMinutes(123)
                        .maxRate(123)
                        .build())
                .serviceName("serviceName")
                .serviceType("serviceType")
                .urlPath("urlPath")
                .build())
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.XRay;

var cfnSamplingRuleProps = new CfnSamplingRuleProps {
    RuleName = "ruleName",
    SamplingRule = new SamplingRuleProperty {
        FixedRate = 123,
        Host = "host",
        HttpMethod = "httpMethod",
        Priority = 123,
        ReservoirSize = 123,
        ResourceArn = "resourceArn",
        ServiceName = "serviceName",
        ServiceType = "serviceType",
        UrlPath = "urlPath",

        // the properties below are optional
        Attributes = new Dictionary<string, string> {
            { "attributesKey", "attributes" }
        },
        RuleArn = "ruleArn",
        RuleName = "ruleName",
        SamplingRateBoost = new SamplingRateBoostProperty {
            CooldownWindowMinutes = 123,
            MaxRate = 123
        },
        Version = 123
    },
    SamplingRuleRecord = new SamplingRuleRecordProperty {
        CreatedAt = "createdAt",
        ModifiedAt = "modifiedAt",
        SamplingRule = new SamplingRuleProperty {
            FixedRate = 123,
            Host = "host",
            HttpMethod = "httpMethod",
            Priority = 123,
            ReservoirSize = 123,
            ResourceArn = "resourceArn",
            ServiceName = "serviceName",
            ServiceType = "serviceType",
            UrlPath = "urlPath",

            // the properties below are optional
            Attributes = new Dictionary<string, string> {
                { "attributesKey", "attributes" }
            },
            RuleArn = "ruleArn",
            RuleName = "ruleName",
            SamplingRateBoost = new SamplingRateBoostProperty {
                CooldownWindowMinutes = 123,
                MaxRate = 123
            },
            Version = 123
        }
    },
    SamplingRuleUpdate = new SamplingRuleUpdateProperty {
        Attributes = new Dictionary<string, string> {
            { "attributesKey", "attributes" }
        },
        FixedRate = 123,
        Host = "host",
        HttpMethod = "httpMethod",
        Priority = 123,
        ReservoirSize = 123,
        ResourceArn = "resourceArn",
        RuleArn = "ruleArn",
        RuleName = "ruleName",
        SamplingRateBoost = new SamplingRateBoostProperty {
            CooldownWindowMinutes = 123,
            MaxRate = 123
        },
        ServiceName = "serviceName",
        ServiceType = "serviceType",
        UrlPath = "urlPath"
    },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnSamplingRuleProps := &CfnSamplingRuleProps{
	RuleName: jsii.String("ruleName"),
	SamplingRule: &SamplingRuleProperty{
		FixedRate: jsii.Number(123),
		Host: jsii.String("host"),
		HttpMethod: jsii.String("httpMethod"),
		Priority: jsii.Number(123),
		ReservoirSize: jsii.Number(123),
		ResourceArn: jsii.String("resourceArn"),
		ServiceName: jsii.String("serviceName"),
		ServiceType: jsii.String("serviceType"),
		UrlPath: jsii.String("urlPath"),

		// the properties below are optional
		Attributes: map[string]*string{
			"attributesKey": jsii.String("attributes"),
		},
		RuleArn: jsii.String("ruleArn"),
		RuleName: jsii.String("ruleName"),
		SamplingRateBoost: &SamplingRateBoostProperty{
			CooldownWindowMinutes: jsii.Number(123),
			MaxRate: jsii.Number(123),
		},
		Version: jsii.Number(123),
	},
	SamplingRuleRecord: &SamplingRuleRecordProperty{
		CreatedAt: jsii.String("createdAt"),
		ModifiedAt: jsii.String("modifiedAt"),
		SamplingRule: &SamplingRuleProperty{
			FixedRate: jsii.Number(123),
			Host: jsii.String("host"),
			HttpMethod: jsii.String("httpMethod"),
			Priority: jsii.Number(123),
			ReservoirSize: jsii.Number(123),
			ResourceArn: jsii.String("resourceArn"),
			ServiceName: jsii.String("serviceName"),
			ServiceType: jsii.String("serviceType"),
			UrlPath: jsii.String("urlPath"),

			// the properties below are optional
			Attributes: map[string]*string{
				"attributesKey": jsii.String("attributes"),
			},
			RuleArn: jsii.String("ruleArn"),
			RuleName: jsii.String("ruleName"),
			SamplingRateBoost: &SamplingRateBoostProperty{
				CooldownWindowMinutes: jsii.Number(123),
				MaxRate: jsii.Number(123),
			},
			Version: jsii.Number(123),
		},
	},
	SamplingRuleUpdate: &SamplingRuleUpdateProperty{
		Attributes: map[string]*string{
			"attributesKey": jsii.String("attributes"),
		},
		FixedRate: jsii.Number(123),
		Host: jsii.String("host"),
		HttpMethod: jsii.String("httpMethod"),
		Priority: jsii.Number(123),
		ReservoirSize: jsii.Number(123),
		ResourceArn: jsii.String("resourceArn"),
		RuleArn: jsii.String("ruleArn"),
		RuleName: jsii.String("ruleName"),
		SamplingRateBoost: &SamplingRateBoostProperty{
			CooldownWindowMinutes: jsii.Number(123),
			MaxRate: jsii.Number(123),
		},
		ServiceName: jsii.String("serviceName"),
		ServiceType: jsii.String("serviceType"),
		UrlPath: jsii.String("urlPath"),
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

ruleNameoptionalstringrule_nameoptionalstrruleNameoptionalStringRuleNameoptionalstringRuleNameoptional*stringdeprecated#
this property has been deprecated

Specify a rule by either name or ARN, but not both.

samplingRuleoptionalIResolvable | CfnSamplingRule.SamplingRulePropertysampling_ruleoptionaltyping.Union[IResolvable, SamplingRuleProperty]samplingRuleoptionalIResolvableSamplingRuleoptionalIResolvableSamplingRuleoptionalinterface{}#
The sampling rule to be created or updated.
samplingRuleRecordoptionalIResolvable | CfnSamplingRule.SamplingRuleRecordPropertysampling_rule_recordoptionaltyping.Union[IResolvable, SamplingRuleRecordProperty]samplingRuleRecordoptionalIResolvableSamplingRuleRecordoptionalIResolvableSamplingRuleRecordoptionalinterface{}deprecated#
this property has been deprecated
samplingRuleUpdateoptionalIResolvable | CfnSamplingRule.SamplingRuleUpdatePropertysampling_rule_updateoptionaltyping.Union[IResolvable, SamplingRuleUpdateProperty]samplingRuleUpdateoptionalIResolvableSamplingRuleUpdateoptionalIResolvableSamplingRuleUpdateoptionalinterface{}deprecated#
this property has been deprecated
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#
An array of key-value pairs to apply to this resource.