Skip to main content

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​

FlagRequiredDescriptionDefault
<functionName>YesFunction name—
<version1>YesFirst version, either a concrete version or $LATEST—
<traffic1>YesTraffic percentage of the first version, 0 to 100—
[version2]NoSecond version—
[traffic2]NoTraffic 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​

  • traffic1 and traffic2 must be integers between 0 and 100
  • version2 and traffic2 must be set together
  • version1 and version2 cannot be the same version
  • With two versions, traffic1 and traffic2 must add up to 100
  • Without version2 and with version1 set to $LATEST, traffic1 must be 100

Notes​

  • With a single version, the remaining traffic goes to $LATEST
  • Traffic changes take effect immediately
  • Adjust traffic during off-peak hours