1 00:00:06,689 --> 00:00:08,621 - All right, so now let's run through a demo 2 00:00:08,621 --> 00:00:12,606 of adding a subnet to an existing VPC. 3 00:00:12,606 --> 00:00:15,997 So here we are, logged in to the ADV US console. 4 00:00:15,997 --> 00:00:18,910 I'm on the VPC dashboard. 5 00:00:18,910 --> 00:00:20,807 And what I want to do is filter 6 00:00:20,807 --> 00:00:23,807 by the VPC that we recently created. 7 00:00:25,008 --> 00:00:29,139 In this case the one at 10 2 00/16. 8 00:00:29,139 --> 00:00:31,766 And then from there, I'm gonna go to subnets. 9 00:00:31,766 --> 00:00:33,066 And you'll see that we don't have any 10 00:00:33,066 --> 00:00:34,901 for this VPC yet. 11 00:00:34,901 --> 00:00:36,081 Now it's important to note, 12 00:00:36,081 --> 00:00:37,851 that you can't launch resources 13 00:00:37,851 --> 00:00:40,761 such as EC2 instances, virtual machines, 14 00:00:40,761 --> 00:00:44,376 or databases, directly into a VPC. 15 00:00:44,376 --> 00:00:46,561 You have to have a subnet, 16 00:00:46,561 --> 00:00:48,134 in order for resources to 17 00:00:48,134 --> 00:00:50,237 have a place to live in the network. 18 00:00:50,237 --> 00:00:53,577 And so we're going to create a subnet. 19 00:00:53,577 --> 00:00:55,308 Now here, I might call this one 20 00:00:55,308 --> 00:00:56,391 our public A. 21 00:00:59,558 --> 00:01:00,911 Because I'm going to put this one, 22 00:01:00,911 --> 00:01:03,005 you'll notice, that I'm going to choose 23 00:01:03,005 --> 00:01:05,028 an availability zone here. 24 00:01:05,028 --> 00:01:07,825 Again, subnets are specific to an availability zone. 25 00:01:07,825 --> 00:01:10,194 So this one is going to be my public subnet 26 00:01:10,194 --> 00:01:11,361 in us-east-2a. 27 00:01:13,638 --> 00:01:16,388 Us-east-2, being the Ohio Region. 28 00:01:18,408 --> 00:01:20,991 Now when I set the slider block 29 00:01:22,011 --> 00:01:24,181 for that subnet, it has to fall 30 00:01:24,181 --> 00:01:26,431 within the range of our VPC 31 00:01:27,430 --> 00:01:29,763 being 10 2 00/16. 32 00:01:31,398 --> 00:01:34,281 I could create a subnet that takes up 33 00:01:34,281 --> 00:01:37,208 the entire range of the VPC if I wanted to. 34 00:01:37,208 --> 00:01:39,977 But by doing so, that would prevent me 35 00:01:39,977 --> 00:01:42,174 from creating any more. 36 00:01:42,174 --> 00:01:43,368 And that's not what I wanna do. 37 00:01:43,368 --> 00:01:47,535 So here, I'm just gonna do 10.2.0.0/24. 38 00:01:49,868 --> 00:01:52,705 That would give me somewhere around 250 39 00:01:52,705 --> 00:01:54,758 useable IP addresses. 40 00:01:54,758 --> 00:01:57,925 So I'm gonna go ahead and create that. 41 00:02:00,206 --> 00:02:01,791 Okay, and sometimes it takes it 42 00:02:01,791 --> 00:02:04,298 a few seconds, it shouldn't take 43 00:02:04,298 --> 00:02:06,041 no more than a minute. 44 00:02:06,041 --> 00:02:06,874 There we go. 45 00:02:06,874 --> 00:02:09,854 And now we can see that we've created a subnet. 46 00:02:09,854 --> 00:02:11,922 We can see what VPC it belongs to. 47 00:02:11,922 --> 00:02:14,302 It belongs to our ADV US live lessons 48 00:02:14,302 --> 00:02:16,031 10 two 16 subnet. 49 00:02:16,031 --> 00:02:20,268 And this subnet has this particular slider range. 50 00:02:20,268 --> 00:02:24,143 Now you might be wondering, a slash 24, 51 00:02:24,143 --> 00:02:26,992 if you're familiar with slider notation, 52 00:02:26,992 --> 00:02:29,305 you would know that slash 24 53 00:02:29,305 --> 00:02:32,222 would allow up to 256 IP addresses. 54 00:02:33,674 --> 00:02:35,961 It's important to note, 55 00:02:35,961 --> 00:02:39,938 that the first four, for any given subnet, 56 00:02:39,938 --> 00:02:43,355 the first four, and the last one address, 57 00:02:44,201 --> 00:02:47,284 are reserved by Amazon for special purposes. 58 00:02:47,284 --> 00:02:49,908 The last address being the dot 255 59 00:02:49,908 --> 00:02:51,456 is the broadcast address. 60 00:02:51,456 --> 00:02:54,795 And that's not used by AWS, so they reserve it. 61 00:02:54,795 --> 00:02:57,215 The first four are reserved for 62 00:02:57,215 --> 00:02:59,101 special purposes like routing 63 00:02:59,101 --> 00:03:00,601 and local VPC DNS. 64 00:03:02,636 --> 00:03:06,803 So we have a subnet in the us-east-2a availability zone. 65 00:03:10,541 --> 00:03:12,414 And we'll go ahead and create one more. 66 00:03:12,414 --> 00:03:14,399 Just to run through it one more time. 67 00:03:14,399 --> 00:03:17,927 And I'm gonna call this Public B, again. 68 00:03:17,927 --> 00:03:20,462 This is arbitrary, what you name it is up to you. 69 00:03:20,462 --> 00:03:23,639 It depends on what this particular subnet 70 00:03:23,639 --> 00:03:25,139 is being used for. 71 00:03:26,247 --> 00:03:28,133 I'm gonna make sure I have the right, 72 00:03:28,133 --> 00:03:29,574 I don't want the default VPC, 73 00:03:29,574 --> 00:03:32,084 I want the one that I created recently. 74 00:03:32,084 --> 00:03:33,835 And this one, I'm going to use 75 00:03:33,835 --> 00:03:36,112 2b availability zone. 76 00:03:36,112 --> 00:03:37,670 Which, again, is a completely different 77 00:03:37,670 --> 00:03:40,834 set of data centers somewhere down the road 78 00:03:40,834 --> 00:03:41,917 away from 2a. 79 00:03:43,471 --> 00:03:46,721 In this case, I'm going to use 10.2.1.0 80 00:03:47,852 --> 00:03:50,165 so that I don't overlap with the previous one. 81 00:03:50,165 --> 00:03:53,498 Again, slash 24 and create that as well. 82 00:03:55,485 --> 00:03:58,735 So there we go, we have our two subnets 83 00:03:59,813 --> 00:04:00,892 that we've created. 84 00:04:00,892 --> 00:04:02,725 Public A and Public B.