YouTube2Text

AWS Containers & Serverless Explained | ECS, EKS, Fargate & Lambda | AWS CLF-C02 Day 9 — Transcript

by Pawan Joshi · 4,304 words · 668 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Welcome back everyone to day nine of our
  2. 0:01AWS builder challenge. Yesterday we
  3. 0:03launched our very first EC2 instance. We
  4. 0:05connected to a Linux server. We explored
  5. 0:07compute, storage and networking as well
  6. 0:10as security. But today we are going to
  7. 0:12ask an important question. What if I
  8. 0:15don't want to manage servers at all?
  9. 0:18Think about it. As a developer, I don't
  10. 0:21enjoy patching the servers, caring about
  11. 0:24operating system updates, or do you like
  12. 0:26wake up excited to configure the
  13. 0:28infrastructure first? Probably not. Most
  14. 0:32developers want to focus on building the
  15. 0:33application, writing the logic, writing
  16. 0:35the code, solving problems, creating new
  17. 0:37features. This desire is what led to two
  18. 0:40major revolutions in cloud computing.
  19. 0:42Containers and serverless computing.
  20. 0:46Today we will learn how cloud platforms
  21. 0:48evolve from virtual machines to
  22. 0:50containers and eventually serverless.
  23. 0:53And by the end of this session you will
  24. 0:55create your first AWS Lambda function.
  25. 0:57You will write code, you will deploy it,
  26. 0:59you will execute it and see as
  27. 1:02automatically handles the infrastructure
  28. 1:04behind the scenes and that's pretty
  29. 1:05amazing when you think about it. So
  30. 1:08let's begin. Let's quickly take a look
  31. 1:10at our today's agenda, today's road map.
  32. 1:13First we will understand the evolution
  33. 1:15of cloud computing. We will compare
  34. 1:18virtual machines, v containers, v
  35. 1:20serverless.
  36. 1:22Then we will explore AWS container
  37. 1:24services. You will hear several new
  38. 1:26names today like ECS, EKS, ECR, fog
  39. 1:30rate. By the end of this session, you
  40. 1:33will understand exactly what each
  41. 1:35service does and when to use it. After
  42. 1:37that, we will dive into AWS Lambda. AWS
  43. 1:41Lambda is one of the most popular
  44. 1:43services. It is uh it's also one of the
  45. 1:46most heavily tested serverless services
  46. 1:48in the cloud practitioner exam. It's
  47. 1:51also one of the most heavily tested
  48. 1:53serverless services in the cloud
  49. 1:54practitioner exam. We will discuss how
  50. 1:57lambda works, what is its pricing, what
  51. 2:00are the lambda limits and also we will
  52. 2:03discuss about some common lambda exam
  53. 2:05scenarios. Then we'll learn to decide
  54. 2:08like when to choose lambda, when to
  55. 2:10choose EC2 or far grid because AWS often
  56. 2:13ask architecture based question in the
  57. 2:15exams and finally we will create our
  58. 2:18first AWS lambda function together. We
  59. 2:20will write code, deploy it and test it.
  60. 2:24Then we will also review the logs in the
  61. 2:27cloudatch. We will understand what
  62. 2:28cloudatch is. By the end of this video,
  63. 2:30you will have deployed code to the cloud
  64. 2:32without launching a single server. So
  65. 2:34this slide is one of the most important
  66. 2:37conceptual slides in the today's lesson.
  67. 2:39To understand Lambda, to understand
  68. 2:41Fargate and to understand the containers
  69. 2:43as well, you first need to understand
  70. 2:45how cloud computing actually evolved. So
  71. 2:47let's start with virtual machines.
  72. 2:50Imagine you own an entire house. In this
  73. 2:54house, you have walls, plumbing,
  74. 2:56electricity, furniture, maintenance,
  75. 2:58everything. And this is similar to
  76. 3:01virtual machines with EC2 provides the
  77. 3:03physical hardware. EC2 provides physical
  78. 3:06hardware and you are responsible for a
  79. 3:09lot of things like in your home you are
  80. 3:11responsible for all these things.
  81. 3:12Plumbing, electricity, furniture. In a
  82. 3:14similar way in EC2 you choose the
  83. 3:18operating system, you install the
  84. 3:19software, you pass the operating system
  85. 3:21and updates is managed by you. security
  86. 3:24scaling everything you have maximum
  87. 3:27flexibility that is you have full
  88. 3:29control but with full control comes
  89. 3:33maximum responsibility
  90. 3:36okay think back to the studies EC2
  91. 3:39instance we launched the server
  92. 3:40connected to Linux updated packages by
  93. 3:42ourselves then installed software that's
  94. 3:44exactly VM management looks like now
  95. 3:48let's move one step further and let's
  96. 3:49discuss about container
  97. 3:52imagine
  98. 3:53Instead of owning house, now you own an
  99. 3:56apartment.
  100. 3:58Now you don't manage the building. You
  101. 4:00don't manage elevator, security guard,
  102. 4:02parking lot, nothing. The building owner
  103. 4:05handles all of that. You focus only on
  104. 4:07your apartment. Containers work in a
  105. 4:10very similar way. Instead of packaging
  106. 4:13an entire operating system, containers
  107. 4:15package application, libraries, its
  108. 4:18dependencies and also its configuration,
  109. 4:22everything the application needs to run.
  110. 4:24Containers are much lighter. They are
  111. 4:28much lighter in compared to the virtual
  112. 4:29machines and they start faster and they
  113. 4:32use fewer resources and it makes
  114. 4:35application deployment much easier. One
  115. 4:38of the most common container
  116. 4:39technologies is Docker. Some of you
  117. 4:43might have used the Docker as well. So
  118. 4:45the key idea is build once and run
  119. 4:47anywhere. If it works on your laptop, it
  120. 4:50should work in the cloud too. Now let's
  121. 4:52move to the serverless. What do this
  122. 4:55serverless means? Imagine staying in a
  123. 4:58hotel room. You don't manage the
  124. 5:00building. You don't manage elevators. No
  125. 5:03maintenance. You don't manage cleaning
  126. 5:05as well. What you do? You simply
  127. 5:08check in. You simply check in into your
  128. 5:11room and use the room and leave and you
  129. 5:13pay only the for the time you actually
  130. 5:16use it. And that's serverless
  131. 5:18technology. Example include lambda. With
  132. 5:21AWS Lambda, you don't have to manage
  133. 5:23servers, operating system, configure,
  134. 5:25scaling, nothing. You want you don't
  135. 5:27have to worry about anything
  136. 5:28infrastructure as well. What you do is
  137. 5:30just give the code to the AWS. AWS will
  138. 5:33handle everything else. This is why
  139. 5:35lambda is so powerful and it's also why
  140. 5:37modern cloud applications increasingly
  141. 5:40rely on serverless architecture also the
  142. 5:42platform that you are using currently
  143. 5:46that might be using serverless
  144. 5:48technology. So let me ask you a few
  145. 5:51question if it is said that which model
  146. 5:54gives the most control what would you
  147. 5:56say virtual machine? Yes. And if it is
  148. 6:00asked which model requires the least
  149. 6:02infrastructure management
  150. 6:05the answer will be serverless. And
  151. 6:08talking about
  152. 6:10model that packages application and
  153. 6:12dependencies together that is container.
  154. 6:15Now we have understanded containers
  155. 6:17conceptually. Let's see how AWS provide
  156. 6:19container services. So today we are not
  157. 6:22deploying containers and that's more of
  158. 6:24the solution architects or developer
  159. 6:26associate topic. But I want you to see
  160. 6:28where these services actually live
  161. 6:30inside the AWS and what they look like.
  162. 6:32So let me show you ECS service. What I
  163. 6:35can do is go to the search bar and
  164. 6:37search ECS. You will find this elastic
  165. 6:40container service. Let me open this. So
  166. 6:43now what I can do is go to the clusters
  167. 6:45and we do create cluster for that. Uh as
  168. 6:48you can see you can click on cluster and
  169. 6:50name the cluster setting forget only
  170. 6:52forget managed whatever you need. You
  171. 6:55can set up monitoring encryption as well
  172. 6:57and then click on create and your
  173. 6:58cluster is done. So we are not going to
  174. 7:01create in this session but we might see
  175. 7:04in further sessions okay but we don't
  176. 7:06need this. Now let me show you another
  177. 7:09service that we are going to read about
  178. 7:11that is EKS.
  179. 7:13From the name only these services are
  180. 7:15clear. If said ECS elastic container
  181. 7:19service
  182. 7:21EKS elastic Kubernetes service you can
  183. 7:26see EKS is Kubernetes on AWS. For cloud
  184. 7:29practitioner the most important thing to
  185. 7:30remember is simple. If the question
  186. 7:32mentions Kubernetes
  187. 7:34think EKS and that's enough. Let me show
  188. 7:37you ECS as well. Uh we have done ECS.
  189. 7:40Let me show you ECR that is elastic
  190. 7:43container registry. Containers are
  191. 7:46packaged as images and those images need
  192. 7:49somewhere to live and that's exactly
  193. 7:51what ECR provides. You can create a
  194. 7:53repository, set up the repository name
  195. 7:56and create the repository.
  196. 7:59And there is also another service we
  197. 8:01talked about far. What do that means? If
  198. 8:05you go to ECS, we saw that. Let me show
  199. 8:09you. Go to cluster and I will click on
  200. 8:12create cluster. Now you can see you have
  201. 8:15option for far. Fargate only that is
  202. 8:17serverless. You don't need to think
  203. 8:19about creating or managing servers.
  204. 8:20Fargate and manage instances means that
  205. 8:23is a bit managed. Manage instances means
  206. 8:26Amazon ECS will manage the patching and
  207. 8:28scaling on your behalf while giving you
  208. 8:30the configurability of about the types
  209. 8:33of instances. Great for more advanced
  210. 8:34workloads. Yeah, you can select whatever
  211. 8:37you need
  212. 8:39and this is the key idea. ECS manage the
  213. 8:41container and Farget provides the
  214. 8:43serverless compute for those containers.
  215. 8:46Now we have seen AWS container services
  216. 8:49on the AWS console itself. Now we can
  217. 8:52read and easily understand what these
  218. 8:55services actually are. So AWS provides
  219. 8:59several services for running containers
  220. 9:01on it. At first these names can sound
  221. 9:03confusing like EKS, ECS, ECR what these
  222. 9:07are. But by the end of this slide you
  223. 9:09will know exactly what is service does.
  224. 9:11You don't need to worry about that. So
  225. 9:13let us start with ECS. ECS. ECS stands
  226. 9:16for elastic container service. Think of
  227. 9:19ECS like an AWS native container
  228. 9:22management platform. So its job is
  229. 9:24simple. Run and manage Docker
  230. 9:26containers. Imagine your application
  231. 9:28consist of five containers. instead of
  232. 9:31manually starting and monitoring each
  233. 9:33one. So, ECS manages them for you. It
  234. 9:36can start containers,
  235. 9:38it can stop containers, it can restart
  236. 9:41the failed containers and it can scale
  237. 9:43containers as well, distribute
  238. 9:44workloads. And the most important thing
  239. 9:45to remember here is ECS is AWS own
  240. 9:50container orchestration service and
  241. 9:53because AWS built it, it's generally
  242. 9:55easier to learn than Kubernetes. For
  243. 9:57many organization, ECS is the simplest
  244. 9:59way to run containers on AWS. Let's talk
  245. 10:02about EKS. Has anyone heard of
  246. 10:04Kubernetes before? You don't need to
  247. 10:07know Kubernetes for cloud practitioner,
  248. 10:09but you should know what EKS is. EKS
  249. 10:12stands for elastic Kubernetes service.
  250. 10:15Okay. So remember the term C here, K
  251. 10:18here. C means container, K means
  252. 10:21Kubernetes.
  253. 10:23So AWS didn't create Kubernetes.
  254. 10:25Kubernetes is an open-source container
  255. 10:27orchestration platform originally
  256. 10:28created by Google. But yeah, many large
  257. 10:31organization use Kubernetes because it
  258. 10:33works across multiple cloud providers.
  259. 10:35AWS created EKS so customer could run
  260. 10:38Kubernetes cluster without managing all
  261. 10:40the underlying complexity. Think of it
  262. 10:43like ECS equal to AWS native solution
  263. 10:46and EKS is the Kubernetes on AWS. Got
  264. 10:50it? Exam tip what I want to give is if a
  265. 10:54question specifically mentions
  266. 10:55Kubernetes the answer is usually EKS.
  267. 10:58Now let's discuss one of my favorite
  268. 11:00services that is Fargate. Imagine you
  269. 11:03want to run a container or you want to
  270. 11:05run containers but you don't want to
  271. 11:07manage the EC2 instances. You don't want
  272. 11:10to manage operating system. You don't
  273. 11:12want to manage patching. You don't want
  274. 11:15to manage the server maintenance just
  275. 11:17continuous. That's exactly what Fargate
  276. 11:19provides. Fargate is a serverless
  277. 11:22compute for containers. You provide the
  278. 11:24container and the AWS provide the
  279. 11:27infrastructure. And here's very
  280. 11:28important point. Fargate is not a
  281. 11:31container orchestration platform.
  282. 11:33Remember that Fargate is a compute
  283. 11:35engine. It works together with ECS or
  284. 11:39EKS. Think of ECS and EKS are the
  285. 11:42managers and Fargate as a worker doing
  286. 11:45the actual compute. Okay, let me tell
  287. 11:47this again. ECS and EKS are the
  288. 11:52container orchestration platform, but
  289. 11:54Fargate is a compute engine. Think of
  290. 11:57ECS and EKS as the managers and think of
  291. 11:59Fargate as the worker doing actual
  292. 12:01compute. The distinction appears
  293. 12:02frequently in certification exam. So you
  294. 12:04must remember the difference between
  295. 12:05them. The last one is ECR, elastic
  296. 12:09container registry. Containers are
  297. 12:11stored as images. But where do those
  298. 12:13images live? That's where ECR comes in.
  299. 12:16ECR stands for elastic container
  300. 12:18registry. Think of ECR as AWS private
  301. 12:22docker image registry. Secure storage
  302. 12:25for container images. If docker hub is a
  303. 12:28public image library, ECR is your
  304. 12:30private AWS version. Developers push
  305. 12:32container images to ECR and then ECS or
  306. 12:36EKS. It pulls the images from them and
  307. 12:40runs them. Easy.
  308. 12:43Now if the question is asked that the
  309. 12:46company wants to run containers without
  310. 12:48managing EC2 servers, what will be the
  311. 12:50answer? Think carefully.
  312. 12:53The answer is Fargate.
  313. 12:55Why? Because this is the compute engine
  314. 12:58for containers. Remember that. And if
  315. 13:01the company specifically requires
  316. 13:03Kubernetes, then you use EKS. Where are
  317. 13:08those container images stored? they are
  318. 13:10stored in registry that is ECR that is
  319. 13:13elastic container registry. Okay. So you
  320. 13:16must have understood that what is ECS,
  321. 13:19EKS, Fargate, ECR. Now let's move to the
  322. 13:23one of the most important AWS services
  323. 13:25ever created that is AWS Lambda. If EC2
  324. 13:30changed how we think about servers,
  325. 13:32Lambda changed how we think about
  326. 13:34applications. Before Lambda existed,
  327. 13:37developers typically launch servers
  328. 13:38before deploying code. With Lambda, AWS
  329. 13:42flipped that model. See, instead of
  330. 13:44managing the servers, instead of
  331. 13:46managing the servers,
  332. 13:48you simply upload the code. That's it.
  333. 13:52AWS handles everything. Infrastructure,
  334. 13:56operating system, scaling, availability,
  335. 14:00patching, monitoring, everything. You
  336. 14:03just focus on the code. That's why
  337. 14:05lambda is called serverless computing.
  338. 14:07Now, here's a key question. When does
  339. 14:10the lambda run? The answer is when an
  340. 14:12event occurs. That's not the case with
  341. 14:15the EC2. Okay? EC2 runs continuously
  342. 14:19until you stop it. That's why it is
  343. 14:21called eventdriven architecture.
  344. 14:24Whenever there is event, then the lambda
  345. 14:27runs. So, let's take a look at some
  346. 14:29examples. Suppose someone requires to
  347. 14:32upload files to S3. The upload event
  348. 14:36automatically triggers the lambda. So
  349. 14:38upload event will automatically triggers
  350. 14:40the lambda and lambda processes the
  351. 14:41file. There is no requirement for
  352. 14:43server.
  353. 14:44Suppose user submit a form to the
  354. 14:47website then the API gateway receives a
  355. 14:50request. API gateway triggers the lambda
  356. 14:52and lambda process the data. Again there
  357. 14:54is no required for ser server. Similar
  358. 14:57goes for these all Dynamob streams,
  359. 15:00cloudatch events, S, SQS message, SNS
  360. 15:02notification. You might hear these terms
  361. 15:06in the further sessions as well. AWS
  362. 15:08provides one of the most generous free
  363. 15:10tiers for Lambda. The first 1 million
  364. 15:13requests per month are free. So every
  365. 15:15month you get this much request and
  366. 15:18these are a lot. And unlike many other
  367. 15:20older free tier benefits, this always
  368. 15:23free offer does not expire. that makes
  369. 15:25lambda perfect for learning. So now let
  370. 15:28us see key limits in pricing. This is
  371. 15:30one of the most tested lambda fact like
  372. 15:33maximum execution time 15 minutes. Let
  373. 15:36me repeat that a single lambda execution
  374. 15:39cannot run longer than 15 minutes. If
  375. 15:42your task need 20 minutes, lambda is not
  376. 15:44the right choice. You would likely need
  377. 15:46EC2, ECS or farate. Student often get
  378. 15:50this wrong in the exam. Remember 15
  379. 15:52minutes is the maximum per single
  380. 15:55function execution. So actually what is
  381. 15:57there in lambda? We do get a function.
  382. 15:59Let's say I have this link. Okay, I
  383. 16:02click on this link. The lambda gets
  384. 16:05triggered and I get the result. But if
  385. 16:08this action takes more than 15 minutes
  386. 16:12then no it it's not the right choice.
  387. 16:15Okay. Lambda is maximum of 15 minutes
  388. 16:17timeout. Another thing lambda scaling.
  389. 16:20One of the coolest thing about Lambda is
  390. 16:22scaling. Suppose one person triggers
  391. 16:23your function. AWS run one execution.
  392. 16:26Suppose 10,000
  393. 16:29person trigger the same function
  394. 16:31simultaneously. AWS automatically
  395. 16:34scales. There is no need for ASG. That
  396. 16:36is called autoscaling groups. There is
  397. 16:38no capacity planning required. No server
  398. 16:40provisioning. It simply works. So what
  399. 16:42happens is for each user a copy of code
  400. 16:46is created and it is served to that
  401. 16:48user. So you don't need to worry about
  402. 16:51infrastructure hardware when you are
  403. 16:53learning about lambda or when you are op
  404. 16:55when you are working with lambda.
  405. 16:57So whenever you see eventdriven
  406. 17:01or serverless or automatic scaling paper
  407. 17:07request okay no server management think
  408. 17:11of lambda and this is almost every time.
  409. 17:14So now let's bring everything together
  410. 17:17because this is exactly how AWS asks
  411. 17:19question in the certification exam. They
  412. 17:21won't ask like what is lambda, what is
  413. 17:23ECS. Instead they will give you a
  414. 17:25scenario and you will choose the correct
  415. 17:27service.
  416. 17:28Now let us see when to use which
  417. 17:30service. Lambda is used for shorter task
  418. 17:33less than 15 minutes and event driven
  419. 17:36architecture and some they are used for
  420. 17:38unpredictable traffic spikes and the
  421. 17:41priority is pay per use. only pay for
  422. 17:44what you use. EC2 when you need full OS
  423. 17:47control when you are thinking to manage
  424. 17:48each and everything yourself in this the
  425. 17:51customer has the maximum responsibility.
  426. 17:54Talking about ECS on far
  427. 17:57it is used for Docker container
  428. 17:59workloads microservices architecture and
  429. 18:02no server management desired. Talking
  430. 18:05about EKS, if you have already invested
  431. 18:07in Kubernetes and you need complex
  432. 18:11container orchestration features, then
  433. 18:13you use EKS. EKS means elastic
  434. 18:15Kubernetes service. EC2 means elastic
  435. 18:18compute cloud. ECS means elastic compute
  436. 18:21service and EKS means elastic kubernetes
  437. 18:25service. Remember that. So in exam
  438. 18:27pattern, let's say if ask serverless
  439. 18:30plus event-driven plus autoscaling that
  440. 18:31is lambda. So in exam the questions
  441. 18:36won't be like what is lambda instead
  442. 18:38they will give you a scenario and you
  443. 18:39will choose the correct service. So
  444. 18:40let's take the scenario a company
  445. 18:42process images whenever the user uploads
  446. 18:44file to S3. Okay traffic traffic is
  447. 18:49unpredictable they want zero server
  448. 18:51management. So what will be the answer?
  449. 18:53The answer will be lambda. Yes. So like
  450. 18:57whenever the file is uploaded lambda
  451. 19:00function is triggered and with that
  452. 19:03function we process the image that is
  453. 19:06going to be uploaded in the S3. So this
  454. 19:09is textbook lambda use case. A company
  455. 19:13wants to run a large application that
  456. 19:15requires full operating system control.
  457. 19:17What would be the answer? Amazon EC2.
  458. 19:21Let's say a company has Docker
  459. 19:22containers and want to avoid managing
  460. 19:24servers. Which service we use? We will
  461. 19:27use Fargate. And a company let's say
  462. 19:30already have invested in Kubernetes and
  463. 19:32across multiple environments.
  464. 19:35Across multiple environments, what will
  465. 19:36be the answer? EKS because Kubernetes is
  466. 19:39the requirement. There is also one more
  467. 19:41thing that is called AppRunner.
  468. 19:44Let me tell you simply about that. Let's
  469. 19:47say a startup wants the simplest way to
  470. 19:49deploy a web application.
  471. 19:51The answer is AppRunner. What does it
  472. 19:54do? We provide the source code. Click on
  473. 19:56deploy and done. Minimal infrastructure
  474. 19:58management. So remember always identify
  475. 20:01the keywords in the exam like
  476. 20:02serverless, lambda, kubernetes, EKS,
  477. 20:05container without services, farget or
  478. 20:07full control if said that is EC2. So
  479. 20:09this approach solves most architecture
  480. 20:12question. So now it's time to stop
  481. 20:14talking about lambda and actually build
  482. 20:16something. Let's create our first
  483. 20:17serverless application. So you will
  484. 20:19understand how they actually work. So
  485. 20:21now let's see. We are going to explore
  486. 20:23lambda. Now let me go to lambdas. I will
  487. 20:27simply search for lambda over here. lb
  488. 20:30bda. Okay. Open this. And now see I do
  489. 20:35have a button called create a function.
  490. 20:38You can click on create a function
  491. 20:41and then author from scratch. Let me
  492. 20:43give it a function name. Let's say say
  493. 20:45hello. So it will say hello to me. Okay.
  494. 20:49and then click on create and let me see
  495. 20:53okay I will choose the runtime as Python
  496. 20:55first as I I'm going to use Python for
  497. 20:58writing the code and do I need anything
  498. 21:00other okay so I don't need anything
  499. 21:03other I will click on create function
  500. 21:06so here we didn't create a server we
  501. 21:08didn't choose RAM we didn't configure
  502. 21:10storage we simply told here's my
  503. 21:13function that's all that's the power of
  504. 21:17serverless computing Now I have a
  505. 21:20function here that is lambda function.
  506. 21:22We have code over here and it says hello
  507. 21:24to AWS SPG. Okay. So you can see
  508. 21:30function name over here. You can see you
  509. 21:32can see test button to test the event
  510. 21:35monitor configuration and many others
  511. 21:39also. You can find this function ARN
  512. 21:42just like S3 bucket and IM users. Notice
  513. 21:45this ARN. Lambda functions have unique
  514. 21:47AWS identifiers. What was ARN? ARN was
  515. 21:51Amazon resource names. Okay. So what you
  516. 21:55can do is let's write our own code. Def
  517. 22:00let me make my own function named LMBDL
  518. 22:03lambda
  519. 22:06handler. Let me give it this event and
  520. 22:09context.
  521. 22:11And let me return something from here.
  522. 22:13Okay. return what I will return is let
  523. 22:17me return with the status code status
  524. 22:20code
  525. 22:21200
  526. 22:23and there will be a message along with
  527. 22:26this that is hello from AWS lambda.
  528. 22:30So once we are done let us try if it
  529. 22:33actually works or not. So what we did is
  530. 22:36we simply u added a function in here in
  531. 22:40lambda we uploaded our code or we wrote
  532. 22:43our code. Now AWS automatically handle
  533. 22:45the servers, scaling, availability,
  534. 22:47operating system, infrastructure. We
  535. 22:48don't need to manage anything at all.
  536. 22:50Now let us test it. Let's create a test
  537. 22:52event. So we can test if our function is
  538. 22:54working or not. I will go to create. I
  539. 22:57will go to test then create new event.
  540. 23:00And now set some event name like my
  541. 23:04let's say first test. My first test.
  542. 23:07Okay. Then you will go to event JSON and
  543. 23:11you can simply write name AWS
  544. 23:16builder. Got it? Let us test this. Okay.
  545. 23:20As you can see status code status code
  546. 23:23is 200 body hello from lambda.
  547. 23:26So you can find each and every
  548. 23:27information um like how much time did it
  549. 23:30take to run build duration how much time
  550. 23:34for how much time we are built max
  551. 23:36memory used resources configured each
  552. 23:38and everything in real world application
  553. 23:41events often come from S3 uploads API
  554. 23:44gateway event bridge Dynamob so today we
  555. 23:47have triggered it manually so
  556. 23:48congratulations you have just executed
  557. 23:51one code inside AWS without launching a
  558. 23:53single server AWS just created the
  559. 23:56infrastructure. What you did was
  560. 23:58executed your code, returned the result
  561. 24:00and then cleaned everything up
  562. 24:01automatically.
  563. 24:05Now let us see eventdriven example. So
  564. 24:08now let me slightly change the code and
  565. 24:10show you how eventdriven things work. Um
  566. 24:14so let me add name over here. Name equal
  567. 24:18to event dot
  568. 24:22get name world. Okay. And inside this uh
  569. 24:26hello what I will do is refer to this
  570. 24:30and yeah got it. All right. So I guess
  571. 24:34it is correct name. All right. So now I
  572. 24:38can deploy the function. See lambda
  573. 24:40functions receive events and events are
  574. 24:42simply the pieces of information sent to
  575. 24:43the function. So we are sending the name
  576. 24:47over here. So let us test if it is
  577. 24:49working or not. Click on test and then
  578. 24:52hello AWS builder.
  579. 24:54Why it showed hello AWS builder is that
  580. 24:58because in the test we have already
  581. 25:01written name as AWS builder. That is why
  582. 25:04it showed me AWS builder. Let me test it
  583. 25:06again. Hello Ram. Now let us test this.
  584. 25:10You can see hello Ram. All right. So
  585. 25:13it's working. So now you can see our
  586. 25:16Lambda function is working fine. Now let
  587. 25:19us explore the cloudatch logs. Now let
  588. 25:22us see the cloudatch logs. Simply you
  589. 25:24can search for cloudatch or yes I have
  590. 25:28this over here
  591. 25:30and then what I will do is go to
  592. 25:33dashboards
  593. 25:34and I will go to automatic dashboard and
  594. 25:36search for lambda. I can simply see my
  595. 25:39logs over here. Every lambda execution
  596. 25:42um automatically generate log. We didn't
  597. 25:44install a login server or we didn't
  598. 25:45install or configure storage. AWS
  599. 25:48automatically integrates lambda with the
  600. 25:50cloudatch. You can see how many
  601. 25:53invocations were done and you can see
  602. 25:56the functions was updated when its
  603. 25:58memory size, code size. So you can find
  604. 26:02event duration, memory, use, request ID,
  605. 26:05each and everything from here. Now we
  606. 26:07will simply go back to lambda and delete
  607. 26:10the function we have just created. Why
  608. 26:12we are deleting this? Do it charges even
  609. 26:15if we are not using it. But we said as
  610. 26:17we will use we will pay but we are not
  611. 26:20invoking this function then we won't be
  612. 26:22charged. It's true but it's a good
  613. 26:24practice to clean up the resources that
  614. 26:27we have uh created and we are if we are
  615. 26:30not using them. So did we create a
  616. 26:32server? No. Did we configure
  617. 26:34autoscaling? No. What triggered our
  618. 26:37function? a test event and where we can
  619. 26:40view event logs, execution logs in the
  620. 26:44cloudatch logs.
  621. 26:46Remember the maximum time for this AWS
  622. 26:49Lambda execution is 15 minutes only.
  623. 26:53Okay. So there's a bonus thing for you
  624. 26:55all. Let me show you how we can trigger
  625. 26:58the event. Let's say I have say hello
  626. 27:01only. I will select NodeJS and click on
  627. 27:03create function. Let me show you the
  628. 27:06available triggers. Actually, in like
  629. 27:08real world architectures, Lambda is
  630. 27:09actually triggered automatically by
  631. 27:10events occurring across the AWS
  632. 27:13services. We don't manually trigger
  633. 27:15every time. That's not the approach. Uh
  634. 27:18so I guess the function is created. No.
  635. 27:20Yeah. Okay. Creating the function say
  636. 27:22hello. So now if you see the
  637. 27:24configuration tab, you can find
  638. 27:27different ways to trigger. As you can
  639. 27:30see trigger you can add trigger you can
  640. 27:33select the source like even your
  641. 27:35function needs to be executed. So you
  642. 27:37can search for S3 if any event in S3
  643. 27:40occurs or you can select API gateway.
  644. 27:44Okay let's see I'm going to use API
  645. 27:46gateway. You can create new API or you
  646. 27:48use an or even use an existing API. Let
  647. 27:51me see. You can create HTTP API webocket
  648. 27:53rest API. For web application you may
  649. 27:56use these rest API HTTP or websocket
  650. 27:58API. uh we actually use serverless
  651. 28:00technology for that serverless framework
  652. 28:03for that. Um we will also understand
  653. 28:05this in some of the projects in the
  654. 28:07upcoming videos but let's but simply
  655. 28:10this is what it is. Okay, day nine
  656. 28:14summary. So what we have done, we have
  657. 28:16seen what do we mean by VNS, container
  658. 28:18and serverless. We saw about ECS, EKS,
  659. 28:21Fargate things and lambda essentials
  660. 28:25like what is eventdriven architecture,
  661. 28:27what is the limit for that and how many
  662. 28:29requests are free and stuff. So what I
  663. 28:31want you to do is today practice 10
  664. 28:34questions on lambda. You might find them
  665. 28:36on the node itself. And tomorrow we will
  666. 28:39explore one of the most versatile and
  667. 28:41widely used storage service in AWS that
  668. 28:43is Amazon S3.

About this transcript

This page contains the full transcript of AWS Containers & Serverless Explained | ECS, EKS, Fargate & Lambda | AWS CLF-C02 Day 9 by Pawan Joshi, generated from the public captions YouTube serves with the video. The transcript has 4,304 words across 668 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.