1 00:00:06,460 --> 00:00:08,010 - Let's take a look at a demo 2 00:00:08,010 --> 00:00:11,990 of creating resources with AWS Cloud Formation. 3 00:00:11,990 --> 00:00:14,350 From the management console dashboard, 4 00:00:14,350 --> 00:00:17,700 we'll go ahead and go to cloud formation 5 00:00:17,700 --> 00:00:20,930 and you'll see here that we'll go ahead and make sure 6 00:00:20,930 --> 00:00:24,300 that' we're here on the stacks menu item 7 00:00:24,300 --> 00:00:27,500 and we can shrink that and 8 00:00:27,500 --> 00:00:30,070 we don't have any stacks yet. 9 00:00:30,070 --> 00:00:32,910 So, before we create one, 10 00:00:32,910 --> 00:00:36,140 let's take a look at some code. 11 00:00:36,140 --> 00:00:37,688 All right so here in my editor 12 00:00:37,688 --> 00:00:41,020 you can see that we are 13 00:00:41,020 --> 00:00:43,400 going to create as the description said, 14 00:00:43,400 --> 00:00:44,910 we're creating a single VPC 15 00:00:44,910 --> 00:00:47,450 with two public and two private subnets. 16 00:00:47,450 --> 00:00:49,590 You'll remember that we did that manually 17 00:00:49,590 --> 00:00:53,027 at least we created a VPC with one public subnet 18 00:00:53,027 --> 00:00:55,920 and one private subnet in an earlier demo. 19 00:00:55,920 --> 00:00:57,700 We did that manually. 20 00:00:57,700 --> 00:01:00,410 And, here we're going to see how 21 00:01:00,410 --> 00:01:02,460 we can do that through automation. 22 00:01:02,460 --> 00:01:05,810 And so again, all of the demos up until now 23 00:01:05,810 --> 00:01:08,280 we have created things manually. 24 00:01:08,280 --> 00:01:10,790 We created VPC's and subnets, 25 00:01:10,790 --> 00:01:13,630 EC2 instances, RDS instance, 26 00:01:13,630 --> 00:01:16,357 we created Dynamo DB tables, 27 00:01:16,357 --> 00:01:19,440 and all of that stuff we did manually. 28 00:01:19,440 --> 00:01:23,620 In a sandbox environment, that's perfectly fine. 29 00:01:23,620 --> 00:01:25,590 You know if you're wanting to get in 30 00:01:25,590 --> 00:01:28,180 and just learn AWS and experiment, 31 00:01:28,180 --> 00:01:29,839 try something out, prototype, 32 00:01:29,839 --> 00:01:32,300 then doing thing manually in the console 33 00:01:32,300 --> 00:01:34,400 is probably perfectly fine. 34 00:01:34,400 --> 00:01:35,770 But in a real world scenario 35 00:01:35,770 --> 00:01:36,900 when you're working with a team 36 00:01:36,900 --> 00:01:39,330 and you're launching real applications out there 37 00:01:39,330 --> 00:01:42,550 for you know, customers and end users to use, 38 00:01:42,550 --> 00:01:44,868 then I would highly, highly recommend 39 00:01:44,868 --> 00:01:47,760 that you avoid doing things manually. 40 00:01:47,760 --> 00:01:50,580 We only did those things manually here, you know, 41 00:01:50,580 --> 00:01:52,650 in this video course as a way 42 00:01:52,650 --> 00:01:55,580 just to illustrate the principal of those services. 43 00:01:55,580 --> 00:01:58,824 But ultimately, I highly recommend 44 00:01:58,824 --> 00:02:02,741 using some kind of an automation tool like cloud formation. 45 00:02:02,741 --> 00:02:04,640 It doesn't have to be cloud formation, 46 00:02:04,640 --> 00:02:06,430 you can use other third party tools 47 00:02:06,430 --> 00:02:10,320 like Teraform or Ansible or something else. 48 00:02:10,320 --> 00:02:12,810 Right, so let's take a look here 49 00:02:12,810 --> 00:02:15,080 at some of the resources that we're creating. 50 00:02:15,080 --> 00:02:19,600 So we're essentially expressing our infrastructure as code. 51 00:02:19,600 --> 00:02:23,810 And so, I don't have to worry about imperative instructions. 52 00:02:23,810 --> 00:02:26,210 I don't have to, you know explicitly state, 53 00:02:26,210 --> 00:02:29,260 hey build this then do that, and then do this 54 00:02:29,260 --> 00:02:31,710 and if this condition, I don't have to worry 55 00:02:31,710 --> 00:02:32,960 about imperative instructions. 56 00:02:32,960 --> 00:02:36,010 I'm simply defining or declaring 57 00:02:36,010 --> 00:02:37,890 the kinds of resources that I want. 58 00:02:37,890 --> 00:02:42,690 So here I want a VPC and then I give it certain properties. 59 00:02:42,690 --> 00:02:44,400 I want DNS support turned on, 60 00:02:44,400 --> 00:02:46,060 I want DNS host names turned on, 61 00:02:46,060 --> 00:02:48,500 and here I want certain tags, 62 00:02:48,500 --> 00:02:51,490 and then down here I'm creating subnets in the same thing. 63 00:02:51,490 --> 00:02:54,140 And so again, you'll notice that their are no 64 00:02:54,140 --> 00:02:55,390 imperative instructions, 65 00:02:55,390 --> 00:02:57,360 its all just me saying hey, 66 00:02:57,360 --> 00:03:00,980 I want these kinds of resources to be built 67 00:03:00,980 --> 00:03:04,740 and I want them to be related in certain ways 68 00:03:04,740 --> 00:03:07,620 and you'll see here that this particular subnet, 69 00:03:07,620 --> 00:03:12,350 subnet DMZA is related to the VPC, 70 00:03:12,350 --> 00:03:15,220 you'll see here that we're referencing the VPC 71 00:03:15,220 --> 00:03:16,930 that we're creating up here. 72 00:03:16,930 --> 00:03:18,747 So, that's really all cloud formation is. 73 00:03:18,747 --> 00:03:21,069 It's a a way of describing, 74 00:03:21,069 --> 00:03:24,470 these are the resources I want created, 75 00:03:24,470 --> 00:03:28,600 and this is the way that I want them to be 76 00:03:28,600 --> 00:03:32,810 related to one another and the cloud formation engine 77 00:03:32,810 --> 00:03:36,000 will take care of all of the imperative instructions. 78 00:03:36,000 --> 00:03:38,470 It will take care of the order of operations 79 00:03:38,470 --> 00:03:39,540 for the most part. 80 00:03:39,540 --> 00:03:43,040 It knows before it can create the subnet 81 00:03:43,040 --> 00:03:46,121 it first has to create the VPC. 82 00:03:46,121 --> 00:03:49,130 It doesn't really matter what order they come in 83 00:03:49,130 --> 00:03:51,640 in this template, it knows that is has to build one 84 00:03:51,640 --> 00:03:52,980 before the other, right. 85 00:03:52,980 --> 00:03:55,271 So this VPC could technically be listed last 86 00:03:55,271 --> 00:03:58,070 in the template, but it would still be built first. 87 00:03:58,070 --> 00:04:02,360 Now you'll also notice that we are here 88 00:04:02,360 --> 00:04:04,200 if you remember from the earlier demo 89 00:04:04,200 --> 00:04:06,040 when we created the VPC, 90 00:04:06,040 --> 00:04:08,960 we had to specify a range of IP addresses. 91 00:04:08,960 --> 00:04:12,500 And the same thing for the subnet. 92 00:04:12,500 --> 00:04:14,640 And that's called a CidreBlock. 93 00:04:14,640 --> 00:04:17,840 It's just a way of expressing a range of IP addresses. 94 00:04:17,840 --> 00:04:19,730 Well if I were to hard code that, 95 00:04:19,730 --> 00:04:23,560 right, if I were to put in 10 dot triple zero 96 00:04:23,560 --> 00:04:26,993 slash 16, you know, if I hard coded that, 97 00:04:26,993 --> 00:04:30,053 then that's all that this template will ever give me. 98 00:04:30,940 --> 00:04:35,370 It becomes inflexible, it becomes too specific. 99 00:04:35,370 --> 00:04:38,700 But if instead of hard coding it, 100 00:04:38,700 --> 00:04:43,700 if I instead use a variable, or a parameter, 101 00:04:44,100 --> 00:04:46,913 then now here I'm referencing, 102 00:04:47,810 --> 00:04:49,790 you'll notice this Ref means reference, 103 00:04:49,790 --> 00:04:52,790 I'm referencing VPC Subnet Cidrs 104 00:04:52,790 --> 00:04:54,540 which is a parameter up here 105 00:04:54,540 --> 00:04:57,660 that I get to specify at run time. 106 00:04:57,660 --> 00:05:01,460 So when I launch this template 107 00:05:01,460 --> 00:05:03,530 to the cloud formation engine, 108 00:05:03,530 --> 00:05:06,778 then I get to enter in that CidreBlock and then 109 00:05:06,778 --> 00:05:09,630 whatever value I put in here, 110 00:05:09,630 --> 00:05:13,200 whatever value I put in there, will come out here. 111 00:05:13,200 --> 00:05:16,410 And then down here AWS give us a number of different 112 00:05:16,410 --> 00:05:18,570 what we call intrinsic functions. 113 00:05:18,570 --> 00:05:22,560 The cloud formation engine allows to perform, 114 00:05:22,560 --> 00:05:25,200 use these intrinsic functions to 115 00:05:25,200 --> 00:05:30,010 make our stacks much more flexible and programatic. 116 00:05:30,010 --> 00:05:33,847 And so here I'm essentially saying hey, 117 00:05:33,847 --> 00:05:38,460 give me a CidreBlock, or a smaller CidreBlock 118 00:05:38,460 --> 00:05:40,130 from a larger CidreBlock. 119 00:05:40,130 --> 00:05:43,110 That's what this intrinsic function does. 120 00:05:43,110 --> 00:05:48,110 It says give me a smaller block from a larger block. 121 00:05:48,840 --> 00:05:52,590 And then that essentially returns in a ray 122 00:05:52,590 --> 00:05:56,970 and from that I can select the you know, 123 00:05:56,970 --> 00:05:59,960 arrays being zero indexed, I can select 124 00:05:59,960 --> 00:06:02,770 the zero element or the first, 125 00:06:02,770 --> 00:06:04,900 meaning the first element in that array. 126 00:06:04,900 --> 00:06:07,980 And so for all of my subnets you'll notice 127 00:06:07,980 --> 00:06:11,340 that they all look the same except down here 128 00:06:11,340 --> 00:06:15,740 on the next subnet, I'm selecting the second element 129 00:06:15,740 --> 00:06:18,360 in that array and so on and so forth. 130 00:06:18,360 --> 00:06:21,970 So by doing that, I don't need to hard code anything, 131 00:06:21,970 --> 00:06:25,130 and I don't need to specify a separate parameter 132 00:06:25,130 --> 00:06:30,130 for each subnet, all four subnets can be derived 133 00:06:30,370 --> 00:06:34,340 from that one CidreBlock that belongs to the VPC 134 00:06:34,340 --> 00:06:37,230 so it makes life, it makes coding this whole thing 135 00:06:37,230 --> 00:06:38,173 that much easier. 136 00:06:39,571 --> 00:06:41,580 And then of course we can add our tags, 137 00:06:41,580 --> 00:06:44,520 you'll see that we're adding a number of different tags 138 00:06:44,520 --> 00:06:47,980 to these subnets and then down here 139 00:06:47,980 --> 00:06:52,393 we're creating subnets that are meant to hold nodes or 140 00:06:52,393 --> 00:06:55,603 private application servers. 141 00:06:57,690 --> 00:06:58,620 Right. 142 00:06:58,620 --> 00:07:01,350 And you'll also notice that event eh availability zone 143 00:07:01,350 --> 00:07:04,200 is programatic, remember earlier in the VPC demo 144 00:07:04,200 --> 00:07:05,853 when we created subnets, 145 00:07:07,860 --> 00:07:10,270 we had to select the availability zone 146 00:07:10,270 --> 00:07:12,330 that the subnet belonged to. 147 00:07:12,330 --> 00:07:15,430 And here instead of hard coding that, 148 00:07:15,430 --> 00:07:18,530 I can also use again, intrinsic functions 149 00:07:18,530 --> 00:07:20,000 to say well, you know what, 150 00:07:20,000 --> 00:07:22,000 give me the availability zones, 151 00:07:22,000 --> 00:07:25,810 get the current availability zones for the current region. 152 00:07:25,810 --> 00:07:28,370 So I don't even have to specify the region here 153 00:07:28,370 --> 00:07:32,920 if I run this in US West two, 154 00:07:32,920 --> 00:07:35,650 then it will give me you know, 155 00:07:35,650 --> 00:07:37,860 all of the availability zones for that region. 156 00:07:37,860 --> 00:07:40,634 If I run this in US East one, 157 00:07:40,634 --> 00:07:43,480 this particular function will give me 158 00:07:43,480 --> 00:07:45,933 all of the availability zones in that region. 159 00:07:46,770 --> 00:07:48,630 And then of course I can select 160 00:07:48,630 --> 00:07:51,400 the third element from that array. 161 00:07:51,400 --> 00:07:54,580 And then of course I can also, 162 00:07:54,580 --> 00:07:57,710 I might want to know, once this stack is completed, 163 00:07:57,710 --> 00:07:59,290 once all of those resources, 164 00:07:59,290 --> 00:08:03,462 the VPC and the four subnets are fully created, 165 00:08:03,462 --> 00:08:05,900 successfully completed, 166 00:08:05,900 --> 00:08:09,860 then I would want to know certain things 167 00:08:09,860 --> 00:08:13,030 about those resources without having to go and dig for it. 168 00:08:13,030 --> 00:08:18,030 So I might want to know the ID of the VPC, the VPC Cidre, 169 00:08:19,237 --> 00:08:21,680 those things I could find, but 170 00:08:21,680 --> 00:08:25,418 by declaring them as explicit outputs, 171 00:08:25,418 --> 00:08:29,010 it puts a number of different values 172 00:08:29,010 --> 00:08:32,050 that would normally be spread across 173 00:08:32,050 --> 00:08:35,280 a lot of different areas, it puts them into one place. 174 00:08:35,280 --> 00:08:38,470 One central place that I can very easily find them 175 00:08:38,470 --> 00:08:40,713 and then of course by exporting them, 176 00:08:40,713 --> 00:08:45,713 I can then leverage those within other templates, right? 177 00:08:47,190 --> 00:08:50,487 Other templates could then build on top of this template 178 00:08:50,487 --> 00:08:53,364 right, so you don't have to write 179 00:08:53,364 --> 00:08:55,320 all of your moving parts, 180 00:08:55,320 --> 00:08:58,650 all of your things that would go into an application, 181 00:08:58,650 --> 00:09:00,680 you know, auto scaling groups, and load balancers, 182 00:09:00,680 --> 00:09:02,650 security groups, and 183 00:09:02,650 --> 00:09:05,780 Dynamo DB tables, RDS instances and so on. 184 00:09:05,780 --> 00:09:08,860 You don't have to put all of it in 185 00:09:09,720 --> 00:09:13,500 one cloud formation template and you shouldn't. 186 00:09:13,500 --> 00:09:15,660 It just becomes too much and so 187 00:09:15,660 --> 00:09:18,200 by using things like exports, 188 00:09:18,200 --> 00:09:22,370 this is a way of helping us to break up our cloud, 189 00:09:22,370 --> 00:09:25,860 what might otherwise become a very large 190 00:09:25,860 --> 00:09:29,330 and unwield-y template, right? 191 00:09:29,330 --> 00:09:30,430 Okay, so let's go ahead, 192 00:09:30,430 --> 00:09:34,320 now that we've kinda explored what the code looks like, 193 00:09:34,320 --> 00:09:38,060 let's go to the cloud formation console 194 00:09:38,060 --> 00:09:39,860 and watch this in action. 195 00:09:39,860 --> 00:09:42,260 We're gonna say create a stack 196 00:09:42,260 --> 00:09:45,470 and of course we cause use a sample template 197 00:09:45,470 --> 00:09:49,310 if we wanted to, we could upload this to S3 198 00:09:49,310 --> 00:09:51,734 and then reference the S3 URL, 199 00:09:51,734 --> 00:09:55,660 or we could just upload it directly to 200 00:09:56,960 --> 00:09:58,320 the cloud formation engine. 201 00:09:58,320 --> 00:10:00,170 Right, so let's go ahead and do that. 202 00:10:12,350 --> 00:10:15,288 All right so now I have my yamil file 203 00:10:15,288 --> 00:10:17,210 that I'm going to upload 204 00:10:17,210 --> 00:10:20,680 and here we need a stack name. 205 00:10:20,680 --> 00:10:24,040 We need to name this collection of resources. 206 00:10:24,040 --> 00:10:27,210 Remember that a stack is a collection 207 00:10:27,210 --> 00:10:29,150 of all of the resources that we just saw. 208 00:10:29,150 --> 00:10:31,430 The VPC and the four subnets. 209 00:10:31,430 --> 00:10:33,350 And the outputs. 210 00:10:33,350 --> 00:10:36,550 And so this particular stack we could call 211 00:10:37,650 --> 00:10:40,123 fundamentals VPC. 212 00:10:41,930 --> 00:10:44,490 And then remember it asks us, 213 00:10:44,490 --> 00:10:47,170 the template had declared one parameter 214 00:10:47,170 --> 00:10:48,850 and this is where we get to enter that. 215 00:10:48,850 --> 00:10:51,870 The CidreBlock for the VPC and then the subnets 216 00:10:51,870 --> 00:10:54,540 will be derived from that. 217 00:10:54,540 --> 00:10:58,500 And so we, earlier we used 10 dot zero, 218 00:10:58,500 --> 00:11:01,280 and then also used 10 dot one, 219 00:11:01,280 --> 00:11:05,263 so here we could say 10 dot two 220 00:11:06,230 --> 00:11:09,653 dot zero zero slash 16. 221 00:11:11,390 --> 00:11:13,780 We'll go ahead and say next. 222 00:11:13,780 --> 00:11:15,760 And then of course we could tag 223 00:11:15,760 --> 00:11:17,970 if we were to tag here then we would, 224 00:11:17,970 --> 00:11:20,040 these tags would be a part of the stack 225 00:11:20,040 --> 00:11:22,090 and they would also be applied, 226 00:11:22,090 --> 00:11:26,480 any tags that we put here are also applied to each resource. 227 00:11:26,480 --> 00:11:30,500 Right, so I could say environment dev. 228 00:11:30,500 --> 00:11:32,270 And so you'll notice if we go back 229 00:11:32,270 --> 00:11:34,380 to the template real quick, 230 00:11:34,380 --> 00:11:37,560 you'll notice that I do have tags 231 00:11:37,560 --> 00:11:40,510 and I usually use this to, 232 00:11:40,510 --> 00:11:45,510 for tags that are specific to that particular resource, 233 00:11:45,580 --> 00:11:48,780 and then for tags that I want to be common 234 00:11:48,780 --> 00:11:51,093 across all resources I will put here. 235 00:11:52,330 --> 00:11:56,360 So here all resources I might put in environment development 236 00:11:56,360 --> 00:11:59,390 or project or cost center, or whatever. 237 00:11:59,390 --> 00:12:03,333 All right, and we could of course add more tags. 238 00:12:05,573 --> 00:12:07,080 We won't worry about that stuff. 239 00:12:07,080 --> 00:12:10,730 Now we can get notifications if we wanted to. 240 00:12:10,730 --> 00:12:13,400 Remember that as cloud formation builds 241 00:12:13,400 --> 00:12:17,600 these resources out and if it encounters an error, 242 00:12:17,600 --> 00:12:19,810 if it completes successfully, 243 00:12:19,810 --> 00:12:22,360 there are a number of events that go along the way 244 00:12:22,360 --> 00:12:24,580 and we could subscribe to those, 245 00:12:24,580 --> 00:12:26,630 and we may want to do that 246 00:12:26,630 --> 00:12:29,270 in order to see a real time output. 247 00:12:29,270 --> 00:12:31,410 You know, rather than having a team, 248 00:12:31,410 --> 00:12:34,070 you know log in to the management console 249 00:12:34,070 --> 00:12:37,190 and sit there and look at that one screen waiting, 250 00:12:37,190 --> 00:12:39,700 they could have these kind of notifications 251 00:12:39,700 --> 00:12:41,670 through the simple notification service, 252 00:12:41,670 --> 00:12:44,850 piped into something like Slack. 253 00:12:44,850 --> 00:12:47,590 So you know, you can continue working in your IDE 254 00:12:48,655 --> 00:12:50,660 on one screen, have Slack on another 255 00:12:50,660 --> 00:12:53,810 and then you know, just glance over and see. 256 00:12:53,810 --> 00:12:57,143 You know, event, event, event, successfully created. 257 00:12:57,980 --> 00:13:01,030 So we'll go next and we'll review that, 258 00:13:01,030 --> 00:13:05,060 yes single VPC with two public and two private subnets. 259 00:13:05,060 --> 00:13:07,780 There is the Cidre, there are my tags, 260 00:13:07,780 --> 00:13:09,540 right so let's go ahead and create that 261 00:13:09,540 --> 00:13:11,910 and you'll see now create in progress 262 00:13:11,910 --> 00:13:14,010 and we can always refresh there. 263 00:13:14,010 --> 00:13:16,110 We don't have to refresh the whole screen 264 00:13:16,110 --> 00:13:19,710 and you can see it has started the creating of the VPC. 265 00:13:19,710 --> 00:13:24,300 Again because it, cloud formation inherently knows 266 00:13:24,300 --> 00:13:28,170 that the subnets depend on the VPC. 267 00:13:28,170 --> 00:13:31,410 In other cases it might not know that 268 00:13:31,410 --> 00:13:33,740 and in other cases, you know for example, 269 00:13:33,740 --> 00:13:37,120 if you had an EC2 instance and an RDS instance 270 00:13:37,120 --> 00:13:40,070 in the same template, 271 00:13:40,070 --> 00:13:42,630 there's nothing inherent about those two 272 00:13:42,630 --> 00:13:44,817 that says one comes before the other so it 273 00:13:44,817 --> 00:13:48,750 would probably try to create them both at the same time. 274 00:13:48,750 --> 00:13:50,130 But you can control that. 275 00:13:50,130 --> 00:13:52,300 You can explicitly state, hey, 276 00:13:52,300 --> 00:13:56,060 this EC2 instance depends on my RDS instance. 277 00:13:56,060 --> 00:13:57,750 Which means that you would want, 278 00:13:57,750 --> 00:13:59,860 you know you could force cloud formation 279 00:13:59,860 --> 00:14:02,050 to build one thing before another. 280 00:14:02,050 --> 00:14:03,570 All right, so there we go just like that 281 00:14:03,570 --> 00:14:06,610 and very quickly it created all, 282 00:14:06,610 --> 00:14:08,610 there are all of our subnets, 283 00:14:08,610 --> 00:14:12,420 it says create complete and then the stack itself, 284 00:14:12,420 --> 00:14:14,400 fundamental VPC, create complete. 285 00:14:14,400 --> 00:14:19,150 And so then if we go to stack info, create complete. 286 00:14:19,150 --> 00:14:21,390 Let's go to events, 287 00:14:21,390 --> 00:14:23,820 and there are all of that, 288 00:14:23,820 --> 00:14:26,110 let's go to resources, there we go. 289 00:14:26,110 --> 00:14:30,960 And now we can see here is the physical ID, 290 00:14:30,960 --> 00:14:32,190 but if we were to click on that, 291 00:14:32,190 --> 00:14:34,070 this would take us to VPC right, 292 00:14:34,070 --> 00:14:36,150 so let's go ahead and do that and that will take us 293 00:14:36,150 --> 00:14:39,243 to the VPC console dashboard. 294 00:14:41,320 --> 00:14:44,760 And now we can see the details about that VPC. 295 00:14:44,760 --> 00:14:47,720 And so if you recall from the earlier demo, 296 00:14:47,720 --> 00:14:49,670 there was a lot more work involved 297 00:14:49,670 --> 00:14:53,060 to essentially do the same thing, right, 298 00:14:53,060 --> 00:14:56,370 to create a VPC and then create subnets, 299 00:14:56,370 --> 00:14:58,700 it took us click by click, screen by screen, 300 00:14:58,700 --> 00:15:01,917 typing things in and 301 00:15:01,917 --> 00:15:05,798 even in that regard we only created two subnets. 302 00:15:05,798 --> 00:15:07,787 And so here with cloud formation 303 00:15:07,787 --> 00:15:11,543 we created a VPC with four subnets 304 00:15:11,543 --> 00:15:14,100 and a fraction of the time and now 305 00:15:14,100 --> 00:15:18,170 they're all managed underneath this one stack. 306 00:15:18,170 --> 00:15:19,590 And so if I decide at some point, 307 00:15:19,590 --> 00:15:21,450 if this were a temporary environment, 308 00:15:21,450 --> 00:15:23,870 if I decided that I don't need it anymore, 309 00:15:23,870 --> 00:15:27,583 then all I have to do is say delete stack. 310 00:15:28,630 --> 00:15:30,100 Or if I wanted to make a change, 311 00:15:30,100 --> 00:15:32,278 if I decided you know what, I wanna add 312 00:15:32,278 --> 00:15:37,270 two more subnets, one more public and one more private, 313 00:15:37,270 --> 00:15:39,460 then I could make that change in my code, 314 00:15:39,460 --> 00:15:41,583 come back here and update the stack. 315 00:15:44,230 --> 00:15:46,240 You can also see the outputs, 316 00:15:46,240 --> 00:15:48,410 So this is that one place where I said 317 00:15:48,410 --> 00:15:50,986 you know, there may be certain pieces of information 318 00:15:50,986 --> 00:15:53,770 that we want centralized in one place 319 00:15:54,870 --> 00:15:57,130 and so here's all that information, 320 00:15:57,130 --> 00:15:59,430 but you can also see that it's being exported 321 00:15:59,430 --> 00:16:02,280 which means that because it's exported, 322 00:16:02,280 --> 00:16:05,310 we can then use this value, 323 00:16:05,310 --> 00:16:10,310 we can use these values to import into another stack. 324 00:16:10,860 --> 00:16:13,240 It allows us to help organize stacks 325 00:16:13,240 --> 00:16:15,470 so we're not putting like I mention earlier, 326 00:16:15,470 --> 00:16:19,370 we're not putting a whole bunch of resources in one stack. 327 00:16:19,370 --> 00:16:23,550 All right, and then we can also see the template here. 328 00:16:23,550 --> 00:16:26,360 You can see the parameters that were used for this 329 00:16:26,360 --> 00:16:28,430 and then of course because this is 330 00:16:28,430 --> 00:16:32,040 a generalized template I could launch it again 331 00:16:32,040 --> 00:16:35,530 and use 10 dot three, 10 dot four, 332 00:16:35,530 --> 00:16:38,800 and so on and create the same kind of infrastructure 333 00:16:38,800 --> 00:16:41,740 over and over again, but with different values. 334 00:16:41,740 --> 00:16:43,940 If I wanted to duplicate this whole thing 335 00:16:43,940 --> 00:16:47,890 in another region I can do that very easily, right. 336 00:16:47,890 --> 00:16:51,900 So again, the takeaway from this is that 337 00:16:51,900 --> 00:16:56,900 the only way to truly realize all the benefits of AWS, 338 00:16:56,928 --> 00:16:59,660 not just the cost savings, but the agility, 339 00:16:59,660 --> 00:17:02,180 the flexibility, the efficiency, 340 00:17:02,180 --> 00:17:05,740 the only way to realize that is through automation. 341 00:17:05,740 --> 00:17:10,740 Right, so again we did things manually in earlier demos 342 00:17:10,770 --> 00:17:15,770 to prove concepts and try to understand concepts 343 00:17:16,610 --> 00:17:21,344 about those service, but this is where the real power is. 344 00:17:21,344 --> 00:17:23,173 Automation. 345 00:17:23,173 --> 00:17:27,050 And again it doesn't have to be cloud formation right. 346 00:17:27,050 --> 00:17:29,990 So again I would encourage you to really explore the world 347 00:17:29,990 --> 00:17:33,350 not just AWS but automating through tools 348 00:17:33,350 --> 00:17:35,820 like cloud formation or third party tools 349 00:17:35,820 --> 00:17:38,143 like Terraform, Ansible and so on.