1 00:00:00,220 --> 00:00:02,660 ‫Okay so let's have a look under the hood 2 00:00:02,660 --> 00:00:04,940 ‫at how Elastic Beanstalk works. 3 00:00:04,940 --> 00:00:07,556 ‫So under the hood, Beanstalk relies on something 4 00:00:07,556 --> 00:00:10,310 ‫called CloudFormation, and we'll see CloudFormation 5 00:00:10,310 --> 00:00:12,381 ‫in this course later on, but as a sneak peak, 6 00:00:12,381 --> 00:00:16,004 ‫CloudFormation is used to provision other AWS services 7 00:00:16,004 --> 00:00:19,170 ‫so we have our infrastructure as code. 8 00:00:19,170 --> 00:00:21,769 ‫So Elastic Beanstalk is using CloudFormation 9 00:00:21,769 --> 00:00:25,250 ‫as it's basis to do a lot of it's operations. 10 00:00:25,250 --> 00:00:27,180 ‫So why would I tell you this? 11 00:00:27,180 --> 00:00:29,930 ‫Well the use case is that using the CloudFormation resources 12 00:00:29,930 --> 00:00:33,110 ‫in your .ebextensions folder that we just saw before, 13 00:00:33,110 --> 00:00:34,970 ‫you can provision anything you want. 14 00:00:34,970 --> 00:00:37,880 ‫So you can provision an ElastiCache, an S3 bucket, 15 00:00:37,880 --> 00:00:40,600 ‫an DynamoDB table, whatever you want and that you'll 16 00:00:40,600 --> 00:00:41,830 ‫see in this course. 17 00:00:41,830 --> 00:00:44,230 ‫So the beautiful thing is that Elastic Beanstalk, 18 00:00:44,230 --> 00:00:46,330 ‫even though the UI only allows you to configurate 19 00:00:46,330 --> 00:00:50,343 ‫a few things, with EB extensions and CloudFormation, 20 00:00:50,343 --> 00:00:53,943 ‫you can configure anything you want in your AWS. 21 00:00:53,943 --> 00:00:56,960 ‫So let's have a sneak peek into it to see how 22 00:00:56,960 --> 00:01:00,380 ‫CloudFormation was used during this session. 23 00:01:00,380 --> 00:01:02,140 ‫So I'm here in Beanstalk and we have 24 00:01:02,140 --> 00:01:04,528 ‫our application with two environments. 25 00:01:04,528 --> 00:01:08,490 ‫So now I'm going to go to CloudFormation and show you 26 00:01:08,490 --> 00:01:10,320 ‫what happens behind the scene. 27 00:01:10,320 --> 00:01:13,690 ‫So in CloudFormation I can see I have two stacks, 28 00:01:13,690 --> 00:01:14,980 ‫don't worry about this one, 29 00:01:14,980 --> 00:01:19,240 ‫I have two stacks called eb-e stack and eb-e stacks 30 00:01:19,240 --> 00:01:20,630 ‫and so they are different. 31 00:01:20,630 --> 00:01:23,910 ‫So the first stack is actually, we can have a look here, 32 00:01:23,910 --> 00:01:26,490 ‫for -en and this one is for -prod. 33 00:01:26,490 --> 00:01:29,230 ‫So let's make it very simple let's look at the -en one. 34 00:01:29,230 --> 00:01:32,190 ‫So if I click on the stack, it corresponds to a 35 00:01:32,190 --> 00:01:34,490 ‫CloudFormation template and you can have a look 36 00:01:34,490 --> 00:01:36,430 ‫by clicking on template and this would show you 37 00:01:36,430 --> 00:01:37,610 ‫the entire template. 38 00:01:37,610 --> 00:01:39,110 ‫Now you don't need to know how to read this right now, 39 00:01:39,110 --> 00:01:41,670 ‫don't worry we'll learn about it later in this course. 40 00:01:41,670 --> 00:01:44,203 ‫But the cool thing is that if you go to resources 41 00:01:44,203 --> 00:01:46,631 ‫it shows you everything this CloudFormation stack 42 00:01:46,631 --> 00:01:48,460 ‫has created for us. 43 00:01:48,460 --> 00:01:51,870 ‫So as we can see, it has created an autoscaling group, 44 00:01:51,870 --> 00:01:54,820 ‫an autoscaling group launch configuration, 45 00:01:54,820 --> 00:01:58,130 ‫there was a Elastic IP, so EIP. 46 00:01:58,130 --> 00:02:01,393 ‫There was as well as EC2 security group, 47 00:02:01,393 --> 00:02:03,810 ‫and there was wait conditions 48 00:02:03,810 --> 00:02:05,520 ‫that we can simply ignore for now. 49 00:02:05,520 --> 00:02:08,140 ‫And then if I go to the other stack, so the -prod stack, 50 00:02:08,140 --> 00:02:10,200 ‫this time they created 16 resources. 51 00:02:10,200 --> 00:02:11,910 ‫So we have an autoscaling group, 52 00:02:11,910 --> 00:02:15,830 ‫a launch configuration, a scaling policy, right here, 53 00:02:15,830 --> 00:02:18,560 ‫another scaling policy, we can simply ignore this. 54 00:02:18,560 --> 00:02:21,000 ‫So CloudFormation, a CloudWatch alarms, another 55 00:02:21,000 --> 00:02:24,083 ‫CloudWatch alarm, this is used for the scaling policies. 56 00:02:24,083 --> 00:02:27,866 ‫And then EC2 security group, another security group. 57 00:02:27,866 --> 00:02:31,640 ‫And finally and elastic load balancer 58 00:02:31,640 --> 00:02:34,700 ‫alongside listener rules and a target group. 59 00:02:34,700 --> 00:02:36,648 ‫So CloudFormation was used behind the scenes 60 00:02:36,648 --> 00:02:38,930 ‫to provision our Elastic Beanstalks. 61 00:02:38,930 --> 00:02:40,700 ‫Now we don't need to touch anything in CloudFormation, 62 00:02:40,700 --> 00:02:43,340 ‫but just so you know using CloudFormation you could deploy 63 00:02:43,340 --> 00:02:46,800 ‫Elasticache, or DynamoDB, or S3 buckets. 64 00:02:46,800 --> 00:02:51,000 ‫And so that would allow us to expand our Elastic Beanstalk 65 00:02:51,000 --> 00:02:53,510 ‫applications to include anything we wanted. 66 00:02:53,510 --> 00:02:56,210 ‫That's it for this Halil review, I hoped you liked it,