

# TrafficRoutingConfig
<a name="API_TrafficRoutingConfig"></a>

The configuration that specifies how traffic is shifted from one version of a Lambda function to another version during an Amazon Lambda deployment, or from one Amazon ECS task set to another during an Amazon ECS deployment.

## Contents
<a name="API_TrafficRoutingConfig_Contents"></a>

 ** timeBasedCanary **   <a name="CodeDeploy-Type-TrafficRoutingConfig-timeBasedCanary"></a>
A configuration that shifts traffic from one version of a Lambda function or ECS task set to another in two increments. The original and target Lambda function versions or ECS task sets are specified in the deployment's AppSpec file.  
Type: [TimeBasedCanary](API_TimeBasedCanary.md) object  
Required: No

 ** timeBasedLinear **   <a name="CodeDeploy-Type-TrafficRoutingConfig-timeBasedLinear"></a>
A configuration that shifts traffic from one version of a Lambda function or Amazon ECS task set to another in equal increments, with an equal number of minutes between each increment. The original and target Lambda function versions or Amazon ECS task sets are specified in the deployment's AppSpec file.  
Type: [TimeBasedLinear](API_TimeBasedLinear.md) object  
Required: No

 ** type **   <a name="CodeDeploy-Type-TrafficRoutingConfig-type"></a>
The type of traffic shifting (`TimeBasedCanary` or `TimeBasedLinear`) used by a deployment configuration.  
Type: String  
Valid Values: `TimeBasedCanary | TimeBasedLinear | TimeBasedFlexible | AllAtOnce`   
Required: No

## See Also
<a name="API_TrafficRoutingConfig_SeeAlso"></a>

For more information about using this API in one of the language-specific Amazon SDKs, see the following:
+  [Amazon SDK for C\+\+](https://docs.amazonaws.cn/goto/SdkForCpp/codedeploy-2014-10-06/TrafficRoutingConfig) 
+  [Amazon SDK for Java V2](https://docs.amazonaws.cn/goto/SdkForJavaV2/codedeploy-2014-10-06/TrafficRoutingConfig) 
+  [Amazon SDK for Ruby V3](https://docs.amazonaws.cn/goto/SdkForRubyV3/codedeploy-2014-10-06/TrafficRoutingConfig) 