1 00:00:00,090 --> 00:00:01,370 ‫So now let's talk about a way 2 00:00:01,370 --> 00:00:04,770 ‫to perform canary deployments on your API gateway. 3 00:00:04,770 --> 00:00:06,720 ‫So the idea is that you want to enable 4 00:00:06,720 --> 00:00:09,540 ‫a way to test a small amount of traffic 5 00:00:09,540 --> 00:00:11,840 ‫on the change you have done on your API gateway. 6 00:00:11,840 --> 00:00:13,700 ‫So usually it's done in production. 7 00:00:13,700 --> 00:00:15,890 ‫So you would choose the amount of percent of traffic 8 00:00:15,890 --> 00:00:17,800 ‫that the canary channel will receive 9 00:00:17,800 --> 00:00:20,210 ‫and this would allow you to test your new version, 10 00:00:20,210 --> 00:00:21,910 ‫for example of your API gateway, 11 00:00:21,910 --> 00:00:24,580 ‫over the backend Lambda function or something like this. 12 00:00:24,580 --> 00:00:27,670 ‫So say our prod stage currently points to version one 13 00:00:27,670 --> 00:00:31,180 ‫and our client wants to be able to test a new version. 14 00:00:31,180 --> 00:00:35,250 ‫So we're going to create a prod stage canary for version two 15 00:00:35,250 --> 00:00:38,860 ‫and what this will do is that we will be allowing our client 16 00:00:38,860 --> 00:00:40,710 ‫to have for example 95% of the traffic 17 00:00:40,710 --> 00:00:43,930 ‫that goes to the existing prod stage which we know works 18 00:00:43,930 --> 00:00:45,840 ‫and behind the scenes automatically 19 00:00:45,840 --> 00:00:48,740 ‫5% of the traffic will go to the canary stage. 20 00:00:48,740 --> 00:00:50,630 ‫From this, we can test all the changes, 21 00:00:50,630 --> 00:00:53,920 ‫look at metrics, look at logs, look at everything, 22 00:00:53,920 --> 00:00:55,740 ‫maybe debug see if everything is working, 23 00:00:55,740 --> 00:00:57,340 ‫and when we're confident, 24 00:00:57,340 --> 00:01:00,170 ‫we can just move over 100% of the traffic 25 00:01:00,170 --> 00:01:02,050 ‫into your canary stage. 26 00:01:02,050 --> 00:01:03,080 ‫So in this example, 27 00:01:03,080 --> 00:01:04,690 ‫the metrics and the logs will be separate, 28 00:01:04,690 --> 00:01:06,510 ‫so this is for better monitoring. 29 00:01:06,510 --> 00:01:08,780 ‫And you can override any stage variables you wanted 30 00:01:08,780 --> 00:01:11,720 ‫for your canary stage and this is equivalent of performing 31 00:01:11,720 --> 00:01:14,800 ‫blue/green deployment with Lambda and API gateway. 32 00:01:14,800 --> 00:01:17,200 ‫So let's go into hands-on to see how that works.