# WebFunctionTraffic

How a WebFunction endpoint splits its traffic between revisions.

Obtainable from: WebFunctionTraffic.single

- Source: [`aws-lambda/lib/webfunction-endpoint.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-lambda/lib/webfunction-endpoint.ts#L218)
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const webFunctionTraffic = lambda.WebFunctionTraffic.single('revisionId');
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_

web_function_traffic = lambda_.WebFunctionTraffic.single("revisionId")
```

Java:

```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.lambda.*;

WebFunctionTraffic webFunctionTraffic = WebFunctionTraffic.single("revisionId");
```

C# / .NET:

```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.Lambda;

var webFunctionTraffic = WebFunctionTraffic.Single("revisionId");
```

Golang:

```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"

webFunctionTraffic := awscdk.Aws_lambda.WebFunctionTraffic_Single(jsii.String("revisionId"))
```

## Methods

- `single(revisionId: string): WebFunctionTraffic // chainable` (static) — Send all of the endpoint's traffic to one revision.

  **Parameters**

  - `revisionId` — the ID of the revision.
