# VersionWeight

A version/weight pair for routing traffic to Lambda functions.

- Source: [`aws-lambda/lib/alias.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-lambda/lib/alias.ts#L332)

## 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';

declare const version: lambda.Version;
const versionWeight: lambda.VersionWeight = {
  version: version,
  weight: 123,
};
```

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_

# version: lambda.Version

version_weight = lambda.VersionWeight(
    version=version,
    weight=123
)
```

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

Version version;

VersionWeight versionWeight = VersionWeight.builder()
        .version(version)
        .weight(123)
        .build();
```

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;

Version version;

var versionWeight = new VersionWeight {
    Version = version,
    Weight = 123
};
```

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"

var version Version

versionWeight := &VersionWeight{
	Version: version,
	Weight: jsii.Number(123),
}
```

## Properties

- `version`: [IVersion](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.IVersion.html) (required) — The version to route traffic to.

- `weight`: number (required) — How much weight to assign to this version (0..1).
