tcb fn config-route
Splits production traffic between function versions by ratio, for canary releases and rollbacks.
Usage
tcb fn config-route <functionName> <version1> <traffic1> [version2] [traffic2]
Flags
| Flag | Required | Description | Default |
|---|---|---|---|
<functionName> | Yes | Function name | — |
<version1> | Yes | First version, either a concrete version or $LATEST | — |
<traffic1> | Yes | Traffic percentage of the first version, 0 to 100 | — |
[version2] | No | Second version | — |
[traffic2] | No | Traffic percentage of the second version, 0 to 100 | — |
Example
# 10% to version 2, the remaining 90% to $LATEST
tcb fn config-route app 2 10
# 30% to version 1, 70% to version 2
tcb fn config-route app 1 30 2 70
# Move 100% of the traffic to version 3
tcb fn config-route app 3 100
Validation
traffic1andtraffic2must be integers between0and100version2andtraffic2must be set togetherversion1andversion2cannot be the same version- With two versions,
traffic1andtraffic2must add up to100 - Without
version2and withversion1set to$LATEST,traffic1must be100
Notes
- With a single version, the remaining traffic goes to
$LATEST - Traffic changes take effect immediately
- Adjust traffic during off-peak hours
Related commands
- Show traffic configuration
- Publish a version: publish before routing traffic