Skip to content

Instantly share code, notes, and snippets.

@adhorn
Last active July 22, 2018 23:29
Show Gist options
  • Save adhorn/94a2413b32612997d089c105446b3c54 to your computer and use it in GitHub Desktop.
Save adhorn/94a2413b32612997d089c105446b3c54 to your computer and use it in GitHub Desktop.
Traffic Shifting Using an Alias (CLI)
(1) version 1 receiving 90% and version 2 receiving 10%
> aws lambda create-alias --name myalias --function-name myfunction --function-version 1 --routing-config AdditionalVersionWeights={"2"=0.1}
(2) you can update the percentage of incoming traffic to version 2, here to 15%.
> aws lambda update-alias --name myalias --function-name myfunction --routing-config AdditionalVersionWeights={"2"=0.15}
Eventually, after several cycle of incremental increase.
(n) you can route all traffic to version 2 by changing the function-version property to point to version 2 and set the routing-config parameter to an empty string, as shown following.
> aws lambda update-alias --name myalias --function-name myfunction --function-version 2 --routing-config ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment