

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS X-Ray
<a name="AWS_XRay"></a>

**Resource types**
+ [AWS::XRay::Group](aws-resource-xray-group.md)
+ [AWS::XRay::ResourcePolicy](aws-resource-xray-resourcepolicy.md)
+ [AWS::XRay::SamplingRule](aws-resource-xray-samplingrule.md)
+ [AWS::XRay::TransactionSearchConfig](aws-resource-xray-transactionsearchconfig.md)

# AWS::XRay::Group
<a name="aws-resource-xray-group"></a>

Use the `AWS::XRay::Group` resource to specify a group with a name and a filter expression. Groups enable the collection of traces that match the filter expression, can be used to filter service graphs and traces, and to supply Amazon CloudWatch metrics.

## Syntax
<a name="aws-resource-xray-group-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-xray-group-syntax.json"></a>

```
{
  "Type" : "AWS::XRay::Group",
  "Properties" : {
      "[FilterExpression](#cfn-xray-group-filterexpression)" : String,
      "[GroupName](#cfn-xray-group-groupname)" : String,
      "[InsightsConfiguration](#cfn-xray-group-insightsconfiguration)" : InsightsConfiguration,
      "[Tags](#cfn-xray-group-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-xray-group-syntax.yaml"></a>

```
Type: AWS::XRay::Group
Properties:
  [FilterExpression](#cfn-xray-group-filterexpression): String
  [GroupName](#cfn-xray-group-groupname): String
  [InsightsConfiguration](#cfn-xray-group-insightsconfiguration): 
    InsightsConfiguration
  [Tags](#cfn-xray-group-tags): 
    - Tag
```

## Properties
<a name="aws-resource-xray-group-properties"></a>

`FilterExpression`  <a name="cfn-xray-group-filterexpression"></a>
The filter expression defining the parameters to include traces.  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`GroupName`  <a name="cfn-xray-group-groupname"></a>
The unique case-sensitive name of the group.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `32`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InsightsConfiguration`  <a name="cfn-xray-group-insightsconfiguration"></a>
The structure containing configurations related to insights.  
+ The InsightsEnabled boolean can be set to true to enable insights for the group or false to disable insights for the group.
+ The NotificationsEnabled boolean can be set to true to enable insights notifications through Amazon EventBridge for the group.
*Required*: No  
*Type*: [InsightsConfiguration](aws-properties-xray-group-insightsconfiguration.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-xray-group-tags"></a>
An array of key-value pairs to apply to this resource.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-xray-group-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-xray-group-return-values"></a>

### Ref
<a name="aws-resource-xray-group-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the Amazon Resource Name (ARN) of the group.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-xray-group-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-xray-group-return-values-fn--getatt-fn--getatt"></a>

`GroupARN`  <a name="GroupARN-fn::getatt"></a>
The group ARN that was created or updated.

## Examples
<a name="aws-resource-xray-group--examples"></a>



### Create group
<a name="aws-resource-xray-group--examples--Create_group"></a>

This example creates a new group called MyGroup.

#### JSON
<a name="aws-resource-xray-group--examples--Create_group--json"></a>

```
{
   "AWSTemplateFormatVersion": "2010-09-09",
   "Resources": {
      "MyGroupResource": {
         "Type": "AWS::XRay::Group",
         "Properties": {
            "GroupName": "MyGroup",
            "FilterExpression": "duration > 10",
            "InsightsConfiguration": {
               "InsightsEnabled": "false",
               "NotificationsEnabled": "false"
            }
         }
      }
   }
}
```

#### YAML
<a name="aws-resource-xray-group--examples--Create_group--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
   MyGroupResource:
      Type: AWS::XRay::Group
      Properties:
         GroupName: MyGroup
         FilterExpression: duration > 10
         InsightsConfiguration:
            InsightsEnabled: false
            NotificationsEnabled: false
```

## See also
<a name="aws-resource-xray-group--seealso"></a>
+  [Configuring groups in the X-Ray console](https://docs.aws.amazon.com//xray/latest/devguide/xray-console-groups.html) 
+  [Configuring groups with the X-Ray API](https://docs.aws.amazon.com//xray/latest/devguide/xray-api-configuration.html#xray-api-configuration-groups) 
+ [CreateGroup](https://docs.aws.amazon.com//xray/latest/api/API_CreateGroup.html) action in the X-Ray API Reference



# AWS::XRay::Group InsightsConfiguration
<a name="aws-properties-xray-group-insightsconfiguration"></a>

The structure containing configurations related to insights.

## Syntax
<a name="aws-properties-xray-group-insightsconfiguration-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-xray-group-insightsconfiguration-syntax.json"></a>

```
{
  "[InsightsEnabled](#cfn-xray-group-insightsconfiguration-insightsenabled)" : Boolean,
  "[NotificationsEnabled](#cfn-xray-group-insightsconfiguration-notificationsenabled)" : Boolean
}
```

### YAML
<a name="aws-properties-xray-group-insightsconfiguration-syntax.yaml"></a>

```
  [InsightsEnabled](#cfn-xray-group-insightsconfiguration-insightsenabled): Boolean
  [NotificationsEnabled](#cfn-xray-group-insightsconfiguration-notificationsenabled): Boolean
```

## Properties
<a name="aws-properties-xray-group-insightsconfiguration-properties"></a>

`InsightsEnabled`  <a name="cfn-xray-group-insightsconfiguration-insightsenabled"></a>
Set the InsightsEnabled value to true to enable insights or false to disable insights.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`NotificationsEnabled`  <a name="cfn-xray-group-insightsconfiguration-notificationsenabled"></a>
Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::XRay::Group Tag
<a name="aws-properties-xray-group-tag"></a>

A map that contains tag keys and tag values to attach to an AWS X-Ray group or sampling rule. For more information about ways to use tags, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the *AWS General Reference*.

The following restrictions apply to tags:
+ Maximum number of user-applied tags per resource: 50
+ Tag keys and values are case sensitive.
+ Don't use `aws:` as a prefix for keys; it's reserved for AWS use. You cannot edit or delete system tags.

## Syntax
<a name="aws-properties-xray-group-tag-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-xray-group-tag-syntax.json"></a>

```
{
  "[Key](#cfn-xray-group-tag-key)" : String,
  "[Value](#cfn-xray-group-tag-value)" : String
}
```

### YAML
<a name="aws-properties-xray-group-tag-syntax.yaml"></a>

```
  [Key](#cfn-xray-group-tag-key): String
  [Value](#cfn-xray-group-tag-value): String
```

## Properties
<a name="aws-properties-xray-group-tag-properties"></a>

`Key`  <a name="cfn-xray-group-tag-key"></a>
A tag key, such as `Stage` or `Name`. A tag key cannot be empty. The key can be a maximum of 128 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: `+ - = . _ : /`  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-xray-group-tag-value"></a>
An optional tag value, such as `Production` or `test-only`. The value can be a maximum of 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: `+ - = . _ : /`  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::XRay::ResourcePolicy
<a name="aws-resource-xray-resourcepolicy"></a>

Use `AWS::XRay::ResourcePolicy` to specify an X-Ray resource-based policy, which grants one or more AWS services and accounts permissions to access X-Ray. Each resource-based policy is associated with a specific AWS account.

## Syntax
<a name="aws-resource-xray-resourcepolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-xray-resourcepolicy-syntax.json"></a>

```
{
  "Type" : "AWS::XRay::ResourcePolicy",
  "Properties" : {
      "[BypassPolicyLockoutCheck](#cfn-xray-resourcepolicy-bypasspolicylockoutcheck)" : Boolean,
      "[PolicyDocument](#cfn-xray-resourcepolicy-policydocument)" : String,
      "[PolicyName](#cfn-xray-resourcepolicy-policyname)" : String
    }
}
```

### YAML
<a name="aws-resource-xray-resourcepolicy-syntax.yaml"></a>

```
Type: AWS::XRay::ResourcePolicy
Properties:
  [BypassPolicyLockoutCheck](#cfn-xray-resourcepolicy-bypasspolicylockoutcheck): Boolean
  [PolicyDocument](#cfn-xray-resourcepolicy-policydocument): String
  [PolicyName](#cfn-xray-resourcepolicy-policyname): String
```

## Properties
<a name="aws-resource-xray-resourcepolicy-properties"></a>

`BypassPolicyLockoutCheck`  <a name="cfn-xray-resourcepolicy-bypasspolicylockoutcheck"></a>
A flag to indicate whether to bypass the resource-based policy lockout safety check.  
*Required*: No  
*Type*: Boolean  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PolicyDocument`  <a name="cfn-xray-resourcepolicy-policydocument"></a>
The resource-based policy document, which can be up to 5kb in size.  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `5120`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`PolicyName`  <a name="cfn-xray-resourcepolicy-policyname"></a>
The name of the resource-based policy. Must be unique within a specific AWS account.  
*Required*: Yes  
*Type*: String  
*Pattern*: `[\w+=,.@-]+`  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-xray-resourcepolicy-return-values"></a>

### Ref
<a name="aws-resource-xray-resourcepolicy-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the policy name.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

## Examples
<a name="aws-resource-xray-resourcepolicy--examples"></a>



### Create resource-based policy
<a name="aws-resource-xray-resourcepolicy--examples--Create_resource-based_policy"></a>

This example creates a resource-based policy called MySnsActiveTracingPolicy, which configures Amazon SNS active tracing.

#### JSON
<a name="aws-resource-xray-resourcepolicy--examples--Create_resource-based_policy--json"></a>

```
{
   "AWSTemplateFormatVersion": "2010-09-09",
   "Resources": {
      "MyResourcePolicy": {
         "Type": "AWS::XRay::ResourcePolicy",
         "Properties": {
            "BypassPolicyLockoutCheck": "false",
            "PolicyDocument": "{
                \"Version\": \"2012-10-17\",
                \"Statement\": [
                  {
                    \"Sid\": \"SNSAccess\",
                    \"Effect\": \"Allow\",
                    \"Principal\": {
                      \"Service\": \"sns.amazonaws.com\"
                    },
                    \"Action\": [
                      \"xray:PutTraceSegments\",
                      \"xray:GetSamplingRules\",
                      \"xray:GetSamplingTargets\"
                    ],
                    \"Resource\": \"*\",
                    \"Condition\": {
                      \"StringEquals\": {
                        \"aws:SourceAccount\": \"my-account-id\"
                      },
                      \"StringLike\": {
                        \"aws:SourceArn\": \"arn:$my-partition:sns:$my-region:$my-account-id:my-topic-name\"
                      }
                    }
                  }
                ]
              }",
            "PolicyName": "MySnsActiveTracingPolicy"
            }
         }
      }
   }
}
```

#### YAML
<a name="aws-resource-xray-resourcepolicy--examples--Create_resource-based_policy--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  MyResourcePolicy:
    Type: AWS::XRay::ResourcePolicy
    Properties:
      BypassPolicyLockoutCheck: false
      PolicyDocument: "{
          \"Version\": \"2012-10-17\",
          \"Statement\": [
            {
              \"Sid\": \"SNSAccess\",
              \"Effect\": \"Allow\",
              \"Principal\": {
                \"Service\": \"sns.amazonaws.com\"
              },
              \"Action\": [
                \"xray:PutTraceSegments\",
                \"xray:GetSamplingRules\",
                \"xray:GetSamplingTargets\"
              ],
              \"Resource\": \"*\",
              \"Condition\": {
                \"StringEquals\": {
                  \"aws:SourceAccount\": \"my-account-id\"
                },
                \"StringLike\": {
                  \"aws:SourceArn\": \"arn:$my-partition:sns:$my-region:$my-account-id:my-topic-name\"
                }
              }
            }
          ]
        }"
      PolicyName: "MySNSActiveTracingPolicy"
```

## See also
<a name="aws-resource-xray-resourcepolicy--seealso"></a>
+  [X-Ray resource-based policies](https://docs.aws.amazon.com//xray/latest/devguide/security_iam_service-with-iam.html#security_iam_service-with-iam-resource-based-policies) 
+  [Identity-based policies and resource-based policies](https://docs.aws.amazon.com//IAM/latest/UserGuide/access_policies_identity-vs-resource.html) 
+ [PutResourcePolicy](https://docs.aws.amazon.com//xray/latest/api/API_PutResourcePolicy.html) action in the X-Ray API Reference



# AWS::XRay::SamplingRule
<a name="aws-resource-xray-samplingrule"></a>

Use the `AWS::XRay::SamplingRule` resource to specify a sampling rule, which controls sampling behavior for instrumented applications. Include a `SamplingRule` entity to create or update a sampling rule.

**Note**  
`SamplingRule.Version` can only be set when creating a sampling rule. Updating the version will cause the update to fail.

Services retrieve rules with [GetSamplingRules](https://docs.aws.amazon.com//xray/latest/api/API_GetSamplingRules.html), and evaluate each rule in ascending order of *priority* for each request. If a rule matches, the service records a trace, borrowing it from the reservoir size. After 10 seconds, the service reports back to X-Ray with [GetSamplingTargets](https://docs.aws.amazon.com//xray/latest/api/API_GetSamplingTargets.html) to get updated versions of each in-use rule. The updated rule contains a trace quota that the service can use instead of borrowing from the reservoir.

## Syntax
<a name="aws-resource-xray-samplingrule-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-xray-samplingrule-syntax.json"></a>

```
{
  "Type" : "AWS::XRay::SamplingRule",
  "Properties" : {
      "[SamplingRule](#cfn-xray-samplingrule-samplingrule)" : SamplingRule,
      "[Tags](#cfn-xray-samplingrule-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-xray-samplingrule-syntax.yaml"></a>

```
Type: AWS::XRay::SamplingRule
Properties:
  [SamplingRule](#cfn-xray-samplingrule-samplingrule): 
    SamplingRule
  [Tags](#cfn-xray-samplingrule-tags): 
    - Tag
```

## Properties
<a name="aws-resource-xray-samplingrule-properties"></a>

`SamplingRule`  <a name="cfn-xray-samplingrule-samplingrule"></a>
The sampling rule to be created or updated.  
*Required*: No  
*Type*: [SamplingRule](aws-properties-xray-samplingrule-samplingrule.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-xray-samplingrule-tags"></a>
An array of key-value pairs to apply to this resource.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-xray-samplingrule-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-xray-samplingrule-return-values"></a>

### Ref
<a name="aws-resource-xray-samplingrule-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the Amazon Resource Name (ARN) of the sampling rule.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-xray-samplingrule-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-xray-samplingrule-return-values-fn--getatt-fn--getatt"></a>

`RuleARN`  <a name="RuleARN-fn::getatt"></a>
The sampling rule ARN that was created or updated.

## Examples
<a name="aws-resource-xray-samplingrule--examples"></a>



**Topics**
+ [Create sampling rule](#aws-resource-xray-samplingrule--examples--Create_sampling_rule)
+ [Update sampling rule](#aws-resource-xray-samplingrule--examples--Update_sampling_rule)

### Create sampling rule
<a name="aws-resource-xray-samplingrule--examples--Create_sampling_rule"></a>

This example creates a new sampling rule called MySamplingRule.

#### JSON
<a name="aws-resource-xray-samplingrule--examples--Create_sampling_rule--json"></a>

```
{
   "AWSTemplateFormatVersion": "2010-09-09T00:00:00.000Z",
   "Resources": {
        "MySamplingRuleResource": {
         "Type": "AWS::XRay::SamplingRule",
         "Properties": {
            "SamplingRule": {
               "RuleName": "MySamplingRule",
               "ResourceARN": "*",
               "Priority": 2,
               "FixedRate": 0.05,
               "ReservoirSize": 50,
               "ServiceName": "MyServiceName",
               "ServiceType": "MyServiceType",
               "Host": "MyHost",
               "HTTPMethod": "GET",
               "URLPath": "*",
               "Version": 1
            }
         }
      }
   }
}
```

#### YAML
<a name="aws-resource-xray-samplingrule--examples--Create_sampling_rule--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
   MySamplingRuleResource:
      Type: AWS::XRay::SamplingRule
      Properties:
         SamplingRule:
            RuleName: MySamplingRule
            ResourceARN: "*"
            Priority: 2
            FixedRate: 0.05
            ReservoirSize: 50
            ServiceName: "MyServiceName"
            ServiceType: "MyServiceType"
            Host: "MyHost"
            HTTPMethod: "GET"
            URLPath: "*"
            Version: 1
```

### Update sampling rule
<a name="aws-resource-xray-samplingrule--examples--Update_sampling_rule"></a>

This example updates an existing sampling rule called MySamplingRule.

#### JSON
<a name="aws-resource-xray-samplingrule--examples--Update_sampling_rule--json"></a>

```
{
   "AWSTemplateFormatVersion": "2010-09-09T00:00:00.000Z",
   "Resources": {
        "MySamplingRuleResource": {
         "Type": "AWS::XRay::SamplingRule",
         "Properties": {
            "SamplingRule": {
               "RuleName": "MySamplingRule",
               "ResourceARN": "*",
               "Priority": 1,
               "FixedRate": 0.07,
               "ReservoirSize": 20,
               "ServiceName": "MyServiceName",
               "ServiceType": "MyServiceType",
               "Host": "MyHost",
               "HTTPMethod": "GET",
               "URLPath": "*"
            }
         }
      }
   }
}
```

#### YAML
<a name="aws-resource-xray-samplingrule--examples--Update_sampling_rule--yaml"></a>

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
   MySamplingRuleResource:
      Type: AWS::XRay::SamplingRule
      Properties:
         SamplingRule:
            RuleName: MySamplingRule
            ResourceARN: "*"
            Priority: 1
            FixedRate: 0.07
            ReservoirSize: 20
            ServiceName: "MyServiceName"
            ServiceType: "MyServiceType"
            Host: "MyHost"
            HTTPMethod: "GET"
            URLPath: "*"
```

## See also
<a name="aws-resource-xray-samplingrule--seealso"></a>
+  [Configuring sampling rules in the X-Ray console](https://docs.aws.amazon.com//xray/latest/devguide/xray-console-sampling.html) 
+  [Using sampling rules with the X-Ray API](https://docs.aws.amazon.com//xray/latest/devguide/xray-api-sampling.html) 
+ [CreateSamplingRule](https://docs.aws.amazon.com//xray/latest/api/API_CreateSamplingRule.html) action in the X-Ray API Reference



# AWS::XRay::SamplingRule SamplingRateBoost
<a name="aws-properties-xray-samplingrule-samplingrateboost"></a>

Enable temporary sampling rate increases when you detect anomalies to improve visibility.

## Syntax
<a name="aws-properties-xray-samplingrule-samplingrateboost-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-xray-samplingrule-samplingrateboost-syntax.json"></a>

```
{
  "[CooldownWindowMinutes](#cfn-xray-samplingrule-samplingrateboost-cooldownwindowminutes)" : Integer,
  "[MaxRate](#cfn-xray-samplingrule-samplingrateboost-maxrate)" : Number
}
```

### YAML
<a name="aws-properties-xray-samplingrule-samplingrateboost-syntax.yaml"></a>

```
  [CooldownWindowMinutes](#cfn-xray-samplingrule-samplingrateboost-cooldownwindowminutes): Integer
  [MaxRate](#cfn-xray-samplingrule-samplingrateboost-maxrate): Number
```

## Properties
<a name="aws-properties-xray-samplingrule-samplingrateboost-properties"></a>

`CooldownWindowMinutes`  <a name="cfn-xray-samplingrule-samplingrateboost-cooldownwindowminutes"></a>
Sets the time window (in minutes) in which only one sampling rate boost can be triggered. After a boost occurs, no further boosts are allowed until the next window.  
*Required*: Yes  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`MaxRate`  <a name="cfn-xray-samplingrule-samplingrateboost-maxrate"></a>
Defines max temporary sampling rate to apply when a boost is triggered. Calculated boost rate by X-Ray will be less than or equal to this max rate.  
*Required*: Yes  
*Type*: Number  
*Minimum*: `0`  
*Maximum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::XRay::SamplingRule SamplingRule
<a name="aws-properties-xray-samplingrule-samplingrule"></a>

A sampling rule that services use to decide whether to instrument a request. Rule fields can match properties of the service, or properties of a request. The service can ignore rules that don't match its properties.

## Syntax
<a name="aws-properties-xray-samplingrule-samplingrule-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-xray-samplingrule-samplingrule-syntax.json"></a>

```
{
  "[Attributes](#cfn-xray-samplingrule-samplingrule-attributes)" : {Key: Value, ...},
  "[FixedRate](#cfn-xray-samplingrule-samplingrule-fixedrate)" : Number,
  "[Host](#cfn-xray-samplingrule-samplingrule-host)" : String,
  "[HTTPMethod](#cfn-xray-samplingrule-samplingrule-httpmethod)" : String,
  "[Priority](#cfn-xray-samplingrule-samplingrule-priority)" : Integer,
  "[ReservoirSize](#cfn-xray-samplingrule-samplingrule-reservoirsize)" : Integer,
  "[ResourceARN](#cfn-xray-samplingrule-samplingrule-resourcearn)" : String,
  "[RuleARN](#cfn-xray-samplingrule-samplingrule-rulearn)" : String,
  "[RuleName](#cfn-xray-samplingrule-samplingrule-rulename)" : String,
  "[SamplingRateBoost](#cfn-xray-samplingrule-samplingrule-samplingrateboost)" : SamplingRateBoost,
  "[ServiceName](#cfn-xray-samplingrule-samplingrule-servicename)" : String,
  "[ServiceType](#cfn-xray-samplingrule-samplingrule-servicetype)" : String,
  "[URLPath](#cfn-xray-samplingrule-samplingrule-urlpath)" : String,
  "[Version](#cfn-xray-samplingrule-samplingrule-version)" : Integer
}
```

### YAML
<a name="aws-properties-xray-samplingrule-samplingrule-syntax.yaml"></a>

```
  [Attributes](#cfn-xray-samplingrule-samplingrule-attributes): 
    Key: Value
  [FixedRate](#cfn-xray-samplingrule-samplingrule-fixedrate): Number
  [Host](#cfn-xray-samplingrule-samplingrule-host): String
  [HTTPMethod](#cfn-xray-samplingrule-samplingrule-httpmethod): String
  [Priority](#cfn-xray-samplingrule-samplingrule-priority): Integer
  [ReservoirSize](#cfn-xray-samplingrule-samplingrule-reservoirsize): Integer
  [ResourceARN](#cfn-xray-samplingrule-samplingrule-resourcearn): String
  [RuleARN](#cfn-xray-samplingrule-samplingrule-rulearn): String
  [RuleName](#cfn-xray-samplingrule-samplingrule-rulename): String
  [SamplingRateBoost](#cfn-xray-samplingrule-samplingrule-samplingrateboost): 
    SamplingRateBoost
  [ServiceName](#cfn-xray-samplingrule-samplingrule-servicename): String
  [ServiceType](#cfn-xray-samplingrule-samplingrule-servicetype): String
  [URLPath](#cfn-xray-samplingrule-samplingrule-urlpath): String
  [Version](#cfn-xray-samplingrule-samplingrule-version): Integer
```

## Properties
<a name="aws-properties-xray-samplingrule-samplingrule-properties"></a>

`Attributes`  <a name="cfn-xray-samplingrule-samplingrule-attributes"></a>
Matches attributes derived from the request.  
*Map Entries:* Maximum number of 5 items.  
*Key Length Constraints:* Minimum length of 1. Maximum length of 32.  
*Value Length Constraints:* Minimum length of 1. Maximum length of 32.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `.{1,}`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`FixedRate`  <a name="cfn-xray-samplingrule-samplingrule-fixedrate"></a>
The percentage of matching requests to instrument, after the reservoir is exhausted.  
*Required*: Yes  
*Type*: Number  
*Minimum*: `0`  
*Maximum*: `1`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Host`  <a name="cfn-xray-samplingrule-samplingrule-host"></a>
Matches the hostname from a request URL.  
*Required*: Yes  
*Type*: String  
*Maximum*: `64`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HTTPMethod`  <a name="cfn-xray-samplingrule-samplingrule-httpmethod"></a>
Matches the HTTP method of a request.  
*Required*: Yes  
*Type*: String  
*Maximum*: `10`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Priority`  <a name="cfn-xray-samplingrule-samplingrule-priority"></a>
The priority of the sampling rule.  
*Required*: Yes  
*Type*: Integer  
*Minimum*: `1`  
*Maximum*: `9999`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ReservoirSize`  <a name="cfn-xray-samplingrule-samplingrule-reservoirsize"></a>
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.  
*Required*: Yes  
*Type*: Integer  
*Minimum*: `0`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ResourceARN`  <a name="cfn-xray-samplingrule-samplingrule-resourcearn"></a>
Matches the ARN of the AWS resource on which the service runs.  
*Required*: Yes  
*Type*: String  
*Maximum*: `500`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RuleARN`  <a name="cfn-xray-samplingrule-samplingrule-rulearn"></a>
The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.  
Specifying a sampling rule by name is recommended, as specifying by ARN will be deprecated in future.
*Required*: Conditional  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`RuleName`  <a name="cfn-xray-samplingrule-samplingrule-rulename"></a>
The name of the sampling rule. Specify a rule by either name or ARN, but not both.  
*Required*: Conditional  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `32`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`SamplingRateBoost`  <a name="cfn-xray-samplingrule-samplingrule-samplingrateboost"></a>
Specifies the multiplier applied to the base sampling rate. This boost allows you to temporarily increase sampling without changing the rule's configuration.  
*Required*: No  
*Type*: [SamplingRateBoost](aws-properties-xray-samplingrule-samplingrateboost.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ServiceName`  <a name="cfn-xray-samplingrule-samplingrule-servicename"></a>
Matches the `name` that the service uses to identify itself in segments.  
*Required*: Yes  
*Type*: String  
*Maximum*: `64`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ServiceType`  <a name="cfn-xray-samplingrule-samplingrule-servicetype"></a>
Matches the `origin` that the service uses to identify its type in segments.  
*Required*: Yes  
*Type*: String  
*Maximum*: `64`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`URLPath`  <a name="cfn-xray-samplingrule-samplingrule-urlpath"></a>
Matches the path from a request URL.  
*Required*: Yes  
*Type*: String  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Version`  <a name="cfn-xray-samplingrule-samplingrule-version"></a>
The version of the sampling rule. `Version` can only be set when creating a new sampling rule.  
*Required*: Conditional  
*Type*: Integer  
*Minimum*: `1`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

# AWS::XRay::SamplingRule Tag
<a name="aws-properties-xray-samplingrule-tag"></a>

A map that contains tag keys and tag values to attach to an AWS X-Ray group or sampling rule. For more information about ways to use tags, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the *AWS General Reference*.

The following restrictions apply to tags:
+ Maximum number of user-applied tags per resource: 50
+ Tag keys and values are case sensitive.
+ Don't use `aws:` as a prefix for keys; it's reserved for AWS use. You cannot edit or delete system tags.

## Syntax
<a name="aws-properties-xray-samplingrule-tag-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-xray-samplingrule-tag-syntax.json"></a>

```
{
  "[Key](#cfn-xray-samplingrule-tag-key)" : String,
  "[Value](#cfn-xray-samplingrule-tag-value)" : String
}
```

### YAML
<a name="aws-properties-xray-samplingrule-tag-syntax.yaml"></a>

```
  [Key](#cfn-xray-samplingrule-tag-key): String
  [Value](#cfn-xray-samplingrule-tag-value): String
```

## Properties
<a name="aws-properties-xray-samplingrule-tag-properties"></a>

`Key`  <a name="cfn-xray-samplingrule-tag-key"></a>
A tag key, such as `Stage` or `Name`. A tag key cannot be empty. The key can be a maximum of 128 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: `+ - = . _ : /`  
*Required*: Yes  
*Type*: String  
*Minimum*: `1`  
*Maximum*: `128`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-xray-samplingrule-tag-value"></a>
An optional tag value, such as `Production` or `test-only`. The value can be a maximum of 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: `+ - = . _ : /`  
*Required*: Yes  
*Type*: String  
*Minimum*: `0`  
*Maximum*: `256`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::XRay::TransactionSearchConfig
<a name="aws-resource-xray-transactionsearchconfig"></a>

Use the `AWS::XRay::TransactionSearchConfig` resource to configure the percentage of traces indexed from CloudWatch Logs to X-Ray for transaction search.

For more information, see [Transaction Search](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search.html) in the *Amazon CloudWatch User Guide*.

## Syntax
<a name="aws-resource-xray-transactionsearchconfig-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-xray-transactionsearchconfig-syntax.json"></a>

```
{
  "Type" : "AWS::XRay::TransactionSearchConfig",
  "Properties" : {
      "[IndexingPercentage](#cfn-xray-transactionsearchconfig-indexingpercentage)" : Number
    }
}
```

### YAML
<a name="aws-resource-xray-transactionsearchconfig-syntax.yaml"></a>

```
Type: AWS::XRay::TransactionSearchConfig
Properties:
  [IndexingPercentage](#cfn-xray-transactionsearchconfig-indexingpercentage): Number
```

## Properties
<a name="aws-resource-xray-transactionsearchconfig-properties"></a>

`IndexingPercentage`  <a name="cfn-xray-transactionsearchconfig-indexingpercentage"></a>
The percentage of spans to be indexed as trace summaries. The value can be set between 0 and 100.  
*Required*: No  
*Type*: Number  
*Minimum*: `0`  
*Maximum*: `100`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-xray-transactionsearchconfig-return-values"></a>

### Ref
<a name="aws-resource-xray-transactionsearchconfig-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the AWS account ID.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-xray-transactionsearchconfig-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-xray-transactionsearchconfig-return-values-fn--getatt-fn--getatt"></a>

`AccountId`  <a name="AccountId-fn::getatt"></a>
The AWS account ID associated with the transaction search configuration.