1 00:00:00,290 --> 00:00:01,890 ‫Last thing I wanted to show you is really 2 00:00:01,890 --> 00:00:03,940 ‫the power of using SAM. 3 00:00:03,940 --> 00:00:06,000 ‫So our SAM file was quite simple. 4 00:00:06,000 --> 00:00:08,610 ‫Remember just YAML, a few lines of code. 5 00:00:08,610 --> 00:00:10,130 ‫But the CloudFormation, I want to show you 6 00:00:10,130 --> 00:00:11,440 ‫how complex it is. 7 00:00:11,440 --> 00:00:13,410 ‫If you click on the hello-world-sam 8 00:00:13,410 --> 00:00:15,090 ‫and you can see that there was creating 9 00:00:15,090 --> 00:00:17,970 ‫so many resources for you, created a few outputs, 10 00:00:17,970 --> 00:00:19,200 ‫or no outputs for this one, obviously, 11 00:00:19,200 --> 00:00:20,520 ‫because we haven't specified it. 12 00:00:20,520 --> 00:00:22,220 ‫Generate a bunch of events, you know, 13 00:00:22,220 --> 00:00:25,060 ‫you could go all the way to looking at what the template is, 14 00:00:25,060 --> 00:00:27,440 ‫which is, here is the original templates, okay? 15 00:00:27,440 --> 00:00:29,130 ‫Which was pretty simple. 16 00:00:29,130 --> 00:00:32,780 ‫And then the process template is, can be huge. 17 00:00:32,780 --> 00:00:34,850 ‫And so if we have a look, we can go ahead 18 00:00:34,850 --> 00:00:37,380 ‫and do other actions. 19 00:00:37,380 --> 00:00:39,170 ‫View/Edit in Designer, 20 00:00:39,170 --> 00:00:40,840 ‫and so in CloudFormation designer 21 00:00:40,840 --> 00:00:45,220 ‫we basically get to see how much was created by SAM. 22 00:00:45,220 --> 00:00:48,120 ‫And so as we can see right here, if we scroll back, 23 00:00:48,120 --> 00:00:49,940 ‫we see that a lot of things were created. 24 00:00:49,940 --> 00:00:53,330 ‫There was an API gateway, there were some permissions, 25 00:00:53,330 --> 00:00:56,870 ‫some Lambda function, a role, and a DynamoDB table. 26 00:00:56,870 --> 00:00:58,620 ‫All of this was generated automatically 27 00:00:58,620 --> 00:01:01,670 ‫by CloudFormation for you and the Serverless framework. 28 00:01:01,670 --> 00:01:03,490 ‫Obviously, it can be even more complicated 29 00:01:03,490 --> 00:01:05,740 ‫if you want it to, but it just gives you an idea 30 00:01:05,740 --> 00:01:09,240 ‫of how easy the management of your Lambda function 31 00:01:09,240 --> 00:01:12,800 ‫and your gateway and your APIs is using SAM. 32 00:01:12,800 --> 00:01:14,790 ‫And I think that's what AWS wants you to understand 33 00:01:14,790 --> 00:01:16,470 ‫before you prepare the exam, 34 00:01:16,470 --> 00:01:19,170 ‫is that SAM is really the one way to deploy 35 00:01:19,170 --> 00:01:22,690 ‫your Lambda function on to AWS and that it 36 00:01:22,690 --> 00:01:25,320 ‫automates a lot of the trouble for you, 37 00:01:25,320 --> 00:01:26,600 ‫and that you have to use CloudFormation 38 00:01:26,600 --> 00:01:28,820 ‫to do package and deploy. 39 00:01:28,820 --> 00:01:30,840 ‫That's it, the last thing I wanted to show you 40 00:01:30,840 --> 00:01:33,640 ‫is that if you go to the Lambda management console, 41 00:01:33,640 --> 00:01:35,400 ‫let's go back to another region, 42 00:01:35,400 --> 00:01:37,790 ‫I want to go to my North Virginia one region, 43 00:01:37,790 --> 00:01:40,110 ‫because I know in the UI it is there. 44 00:01:40,110 --> 00:01:43,100 ‫If I create a function, right here I go to my dashboard 45 00:01:43,100 --> 00:01:45,550 ‫and create a function, we can see that there's the 46 00:01:45,550 --> 00:01:48,380 ‫third option called the Serverless Application Repository. 47 00:01:48,380 --> 00:01:51,770 ‫And so this is actually a bunch of SAM templates 48 00:01:51,770 --> 00:01:54,010 ‫created by a lot of people and you can 49 00:01:54,010 --> 00:01:57,040 ‫look through and see whatever these people have created. 50 00:01:57,040 --> 00:01:59,800 ‫But if we go to hello-world, there must be a hello-world, 51 00:01:59,800 --> 00:02:01,470 ‫there is a hello-world right here. 52 00:02:01,470 --> 00:02:04,550 ‫And so if we go to hello-world-python we click on it, 53 00:02:04,550 --> 00:02:06,050 ‫we get to see the source code, 54 00:02:06,050 --> 00:02:09,030 ‫we get to see the template which generates this 55 00:02:09,030 --> 00:02:10,770 ‫and we see this is a Serverless function 56 00:02:10,770 --> 00:02:11,800 ‫that gets generated. 57 00:02:11,800 --> 00:02:13,830 ‫And there is a Transform of Serverless, 58 00:02:13,830 --> 00:02:16,080 ‫so this is a SAM template and so on. 59 00:02:16,080 --> 00:02:19,040 ‫So you're able to see a lot of different SAM templates 60 00:02:19,040 --> 00:02:20,860 ‫created by other people. 61 00:02:20,860 --> 00:02:22,710 ‫And if I go right back down, 62 00:02:22,710 --> 00:02:25,400 ‫there are over 350 applications in there. 63 00:02:25,400 --> 00:02:27,760 ‫So whatever SAM template you want to create, 64 00:02:27,760 --> 00:02:30,290 ‫probably you can find an example in here. 65 00:02:30,290 --> 00:02:31,220 ‫So I hope that was helpful, 66 00:02:31,220 --> 00:02:33,750 ‫I hope that was a good overview of how SAM works, 67 00:02:33,750 --> 00:02:35,700 ‫and I will see you in the next lecture.