

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

# AWS::Lambda::Function TracingConfig
<a name="aws-properties-lambda-function-tracingconfig"></a>

The function's [Amazon X-Ray](https://docs.amazonaws.cn/lambda/latest/dg/services-xray.html) tracing configuration. To sample and record incoming requests, set `Mode` to `Active`.

## Syntax
<a name="aws-properties-lambda-function-tracingconfig-syntax"></a>

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

### JSON
<a name="aws-properties-lambda-function-tracingconfig-syntax.json"></a>

```
{
  "[Mode](#cfn-lambda-function-tracingconfig-mode)" : String
}
```

### YAML
<a name="aws-properties-lambda-function-tracingconfig-syntax.yaml"></a>

```
  [Mode](#cfn-lambda-function-tracingconfig-mode): String
```

## Properties
<a name="aws-properties-lambda-function-tracingconfig-properties"></a>

`Mode`  <a name="cfn-lambda-function-tracingconfig-mode"></a>
The tracing mode.  
*Required*: No  
*Type*: String  
*Allowed values*: `Active | PassThrough`  
*Update requires*: [No interruption](https://docs.amazonaws.cn/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Examples
<a name="aws-properties-lambda-function-tracingconfig--examples"></a>

### Tracing Configuration
<a name="aws-properties-lambda-function-tracingconfig--examples--Tracing_Configuration"></a>

Enable active tracing on a function.

#### YAML
<a name="aws-properties-lambda-function-tracingconfig--examples--Tracing_Configuration--yaml"></a>

```
      TracingConfig:
        Mode: Active
```