1 00:00:00,380 --> 00:00:01,440 ‫Welcome to this section 2 00:00:01,440 --> 00:00:04,460 ‫on Deploying and Managing Infrastructure at Scale. 3 00:00:04,460 --> 00:00:06,010 ‫In this section, we'll see different ways 4 00:00:06,010 --> 00:00:08,672 ‫to deploy your workloads onto AWS. 5 00:00:08,672 --> 00:00:10,750 ‫And the first technology I want to talk about 6 00:00:10,750 --> 00:00:12,334 ‫is CloudFormation. 7 00:00:12,334 --> 00:00:15,660 ‫So CloudFormation is such an important technology in AWS 8 00:00:15,660 --> 00:00:17,740 ‫because it is a declarative way of outlining 9 00:00:17,740 --> 00:00:20,260 ‫your AWS infrastructure, for any resources. 10 00:00:20,260 --> 00:00:22,190 ‫And most of them are supported. 11 00:00:22,190 --> 00:00:24,510 ‫So to give you a concrete example in CloudFormation, 12 00:00:24,510 --> 00:00:27,000 ‫you would say, I want a security group, 13 00:00:27,000 --> 00:00:28,810 ‫I want two EC2 instances 14 00:00:28,810 --> 00:00:30,720 ‫that will be using the security group, 15 00:00:30,720 --> 00:00:32,690 ‫I also want an S3 bucket, 16 00:00:32,690 --> 00:00:35,880 ‫and I want a load balancer in front of all these machines. 17 00:00:35,880 --> 00:00:38,640 ‫Then CloudFormation automatically creates all these things 18 00:00:38,640 --> 00:00:42,080 ‫for you, in the right order, with the exact configuration 19 00:00:42,080 --> 00:00:43,270 ‫that you specify. 20 00:00:43,270 --> 00:00:46,430 ‫So the benefits of using CloudFormation are multiple, 21 00:00:46,430 --> 00:00:48,800 ‫but the first one is that all your infrastructure 22 00:00:48,800 --> 00:00:50,160 ‫is as code. 23 00:00:50,160 --> 00:00:51,960 ‫That means that you will never, ever 24 00:00:51,960 --> 00:00:54,700 ‫create resources manually like we've done in this course, 25 00:00:54,700 --> 00:00:56,280 ‫which is excellent for control. 26 00:00:56,280 --> 00:00:58,700 ‫And that means that anytime you do a changes 27 00:00:58,700 --> 00:01:01,600 ‫to how your AWS cloud is doing, 28 00:01:01,600 --> 00:01:04,540 ‫then it needs to be reviewed through code review, 29 00:01:04,540 --> 00:01:07,500 ‫which is a great way to operate in a cloud. 30 00:01:07,500 --> 00:01:09,490 ‫On top of things, there is a cost advantage 31 00:01:09,490 --> 00:01:11,590 ‫because each resource within this stack 32 00:01:11,590 --> 00:01:14,350 ‫is going to get a tag that is going to be similar 33 00:01:14,350 --> 00:01:17,180 ‫to all the other resources creating within the stack. 34 00:01:17,180 --> 00:01:20,810 ‫And you can also easily estimate the cost of your resources 35 00:01:20,810 --> 00:01:22,510 ‫using the CloudFormation template. 36 00:01:22,510 --> 00:01:24,670 ‫And finally, thanks to CloudFormation, 37 00:01:24,670 --> 00:01:26,360 ‫you can have the saving strategy. 38 00:01:26,360 --> 00:01:29,340 ‫For example, you can say that in some environment 39 00:01:29,340 --> 00:01:32,060 ‫you could automate the deletion of all the templates 40 00:01:32,060 --> 00:01:35,150 ‫at 5 p.m, which will delete all the associated resources 41 00:01:35,150 --> 00:01:37,930 ‫with that template, and then recreate it at 9 a.m. 42 00:01:37,930 --> 00:01:39,460 ‫or 8 a.m., safely. 43 00:01:39,460 --> 00:01:40,740 ‫And so therefore, you have cost savings 44 00:01:40,740 --> 00:01:42,400 ‫because you don't have any resources 45 00:01:42,400 --> 00:01:44,400 ‫between 5 p.m. and 8 a.m. 46 00:01:44,400 --> 00:01:46,223 ‫We CloudFormation, it's super easy to create 47 00:01:46,223 --> 00:01:47,830 ‫and delete resources, 48 00:01:47,830 --> 00:01:50,700 ‫which is one of the biggest cloud principle. 49 00:01:50,700 --> 00:01:51,533 ‫Then for productivity. 50 00:01:51,533 --> 00:01:53,460 ‫So as I said, you are able to destroy 51 00:01:53,460 --> 00:01:55,760 ‫and recreate the infrastructure on the fly. 52 00:01:55,760 --> 00:01:58,230 ‫It's also generating diagrams for you, 53 00:01:58,230 --> 00:02:00,780 ‫for your templates, as we'll see very soon, quickly, 54 00:02:00,780 --> 00:02:02,420 ‫and there's declarative programming. 55 00:02:02,420 --> 00:02:03,600 ‫So you don't need to figure out 56 00:02:03,600 --> 00:02:05,560 ‫if you need to create a DynamoDB table, 57 00:02:05,560 --> 00:02:08,700 ‫first on EC2 instance or all these things together. 58 00:02:08,700 --> 00:02:10,700 ‫The CloudFormation template is smart enough 59 00:02:10,700 --> 00:02:12,910 ‫to figure out how to do things. 60 00:02:12,910 --> 00:02:15,830 ‫Finally, with CloudFormation, we don't re-invent the wheel. 61 00:02:15,830 --> 00:02:17,960 ‫So that means that we can leverage existing templates 62 00:02:17,960 --> 00:02:18,830 ‫on the web. 63 00:02:18,830 --> 00:02:20,470 ‫We can leverage documentation 64 00:02:20,470 --> 00:02:22,150 ‫and that CloudFormation supports 65 00:02:22,150 --> 00:02:24,140 ‫almost all AWS resources. 66 00:02:24,140 --> 00:02:25,900 ‫That means that everything we'll see in this course 67 00:02:25,900 --> 00:02:27,610 ‫is supportive of CloudFormation. 68 00:02:27,610 --> 00:02:29,540 ‫And in case it isn't, you can use something called 69 00:02:29,540 --> 00:02:32,790 ‫a custom resource, for resources that are not supported. 70 00:02:32,790 --> 00:02:36,450 ‫So CloudFormation really is the base of infrastructure 71 00:02:36,450 --> 00:02:38,450 ‫as code on AWS. 72 00:02:38,450 --> 00:02:41,270 ‫So as I said, you could see the CloudFormation visually 73 00:02:41,270 --> 00:02:42,770 ‫to see a diagram of what is created. 74 00:02:42,770 --> 00:02:46,430 ‫So I took an online WordPress CloudFormation Stack, 75 00:02:46,430 --> 00:02:48,260 ‫and then I went into the designer 76 00:02:48,260 --> 00:02:51,600 ‫to see what it was giving me, and it gave me this diagram. 77 00:02:51,600 --> 00:02:52,690 ‫So as we can see here, 78 00:02:52,690 --> 00:02:54,720 ‫we can see the different components that are created. 79 00:02:54,720 --> 00:02:56,810 ‫For example, we have security groups, 80 00:02:56,810 --> 00:02:59,420 ‫we have an ALB listener, we have a launch configuration, 81 00:02:59,420 --> 00:03:02,730 ‫a load balancer, a database instance for RDS 82 00:03:02,730 --> 00:03:04,090 ‫and an auto-scaling group. 83 00:03:04,090 --> 00:03:06,890 ‫And confirmation is smart enough to create this diagram, 84 00:03:06,890 --> 00:03:08,500 ‫but also creates all the relationships 85 00:03:08,500 --> 00:03:11,640 ‫between all these components, which is very handy. 86 00:03:11,640 --> 00:03:13,700 ‫As we can see, we can see all the resources 87 00:03:13,700 --> 00:03:15,040 ‫and their relations. 88 00:03:15,040 --> 00:03:16,820 ‫So from an exam perspective, 89 00:03:16,820 --> 00:03:18,560 ‫CloudFormation is going to be used 90 00:03:18,560 --> 00:03:21,040 ‫when we have infrastructure as code, 91 00:03:21,040 --> 00:03:23,820 ‫when we need to repeat an architecture 92 00:03:23,820 --> 00:03:26,450 ‫in different environments, different regions, 93 00:03:26,450 --> 00:03:28,930 ‫or even different AWS accounts. 94 00:03:28,930 --> 00:03:29,763 ‫So that's it for me. 95 00:03:29,763 --> 00:03:30,790 ‫I will see you in the next lecture 96 00:03:30,790 --> 00:03:33,363 ‫for a short practice on CloudFormation.