# TimeBasedLinearTrafficRouting

Define a traffic routing config of type 'TimeBasedLinear'.

Extends: [TrafficRouting](/cdk/api/v2/docs/aws-cdk-lib.aws_codedeploy.TrafficRouting.html) › TimeBasedLinearTrafficRouting

- Source: [`aws-codedeploy/lib/traffic-routing-config.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-codedeploy/lib/traffic-routing-config.ts#L166)
- Type last changed: v2.45.0 · 6 Oct 2022

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codedeploy as codedeploy } from 'aws-cdk-lib';
const timeBasedLinearTrafficRouting = codedeploy.TimeBasedLinearTrafficRouting.allAtOnce();
```

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_codedeploy as codedeploy

time_based_linear_traffic_routing = codedeploy.TimeBasedLinearTrafficRouting.all_at_once()
```

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

TrafficRouting timeBasedLinearTrafficRouting = TimeBasedLinearTrafficRouting.allAtOnce();
```

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

var timeBasedLinearTrafficRouting = TimeBasedLinearTrafficRouting.AllAtOnce();
```

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"

timeBasedLinearTrafficRouting := awscdk.Aws_codedeploy.TimeBasedLinearTrafficRouting_AllAtOnce()
```

## Initializer

TypeScript:

```ts
new TimeBasedLinearTrafficRouting(props: TimeBasedLinearTrafficRoutingProps)
```

Python:

```python
TimeBasedLinearTrafficRouting(props: TimeBasedLinearTrafficRoutingProps)
```

Java:

```java
new TimeBasedLinearTrafficRouting(TimeBasedLinearTrafficRoutingProps props)
```

C# / .NET:

```csharp
new TimeBasedLinearTrafficRouting(TimeBasedLinearTrafficRoutingProps props)
```

Golang:

```go
NewTimeBasedLinearTrafficRouting(Props TimeBasedLinearTrafficRoutingProps)
```

## Properties

- `interval`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The amount of time between additional traffic shifts.

- `percentage`: number — The percentage to increase traffic on each traffic shift.

## Methods

- `allAtOnce(): TrafficRouting` (static) — Shifts 100% of traffic in a single shift.

- `bind(_scope: Construct): TrafficRoutingConfig` — Return a TrafficRoutingConfig of type `TimeBasedLinear`.

- `timeBasedCanary(props: TimeBasedCanaryTrafficRoutingProps): TrafficRouting` (static) — Shifts a specified percentage of traffic, waits for a specified amount of time, then shifts the rest of traffic.

- `timeBasedLinear(props: TimeBasedLinearTrafficRoutingProps): TrafficRouting` (static) — Keeps shifting a specified percentage of traffic until reaching 100%, waiting for a specified amount of time in between each traffic shift.
