WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.100 --> 00:00:10.300
In this video, we're going to explore a fundamental building block of cloud computing

1
00:00:10.300 --> 00:00:13.200
 called virtual private cloud or VPC.

2
00:00:14.900 --> 00:00:17.200
A VPC is a virtual Network that

3
00:00:17.200 --> 00:00:20.500
 you control that resembles a traditional Network. You might have used or

4
00:00:20.500 --> 00:00:23.700
 seen it enables you to launch resources inside your

5
00:00:23.700 --> 00:00:27.500
 own private Cloud. It has features like subnets IP

6
00:00:26.500 --> 00:00:29.600
 addressing routing gateways and

7
00:00:29.600 --> 00:00:30.300
 flow logs.

8
00:00:30.700 --> 00:00:33.400
Subnets are a range of IP addresses inside your

9
00:00:33.400 --> 00:00:33.900
 VPC.

10
00:00:34.900 --> 00:00:38.100
IP addressing allows you to choose either ipv4

11
00:00:37.100 --> 00:00:40.400
 or IPv6 addresses for

12
00:00:40.400 --> 00:00:41.000
 your endpoints.

13
00:00:41.900 --> 00:00:44.400
routing directs traffic to and from your subnets

14
00:00:44.400 --> 00:00:45.400
 and gateways

15
00:00:46.800 --> 00:00:48.900
gateways connect your VPC to other networks

16
00:00:49.700 --> 00:00:53.100
finally flow logs captures traffic in and

17
00:00:52.100 --> 00:00:55.500
 out of your interfaces inside your network for auditing

18
00:00:55.500 --> 00:00:55.900
 purposes.

19
00:00:57.500 --> 00:01:00.200
Okay. So this is what we want to do in this

20
00:01:00.200 --> 00:01:03.400
 video. We'll review the VPC resource inside the

21
00:01:03.400 --> 00:01:06.300
 AWS console. We will use search and discover

22
00:01:06.300 --> 00:01:09.300
 some of the attributes that make up a VPC after that.

23
00:01:09.300 --> 00:01:12.600
 We'll head over to a terminal and open up the VPC terraform

24
00:01:12.600 --> 00:01:14.100
 file. Let's get started.

25
00:01:15.300 --> 00:01:18.900
Okay, here we are over on AWS console

26
00:01:18.900 --> 00:01:21.700
 once again, and since this

27
00:01:21.700 --> 00:01:24.100
 video is gonna be about VPC. We're gonna

28
00:01:24.100 --> 00:01:27.000
 first go up to the search bar. And then we're going to type in

29
00:01:27.700 --> 00:01:30.000
 VPC to find our component as you

30
00:01:30.300 --> 00:01:31.300
 see here. It's the top result.

31
00:01:32.100 --> 00:01:32.600
Click it.

32
00:01:34.600 --> 00:01:37.000
Here we are on vpc's main page where you can

33
00:01:37.300 --> 00:01:40.200
 see all the network components that are associated with

34
00:01:40.200 --> 00:01:40.900
 the VPC.

35
00:01:41.800 --> 00:01:43.300
Go ahead and click on VPC.

36
00:01:44.100 --> 00:01:46.200
And we'll go into the VPC Details page.

37
00:01:47.200 --> 00:01:50.200
Okay, this is the VPC Details page. And as

38
00:01:50.200 --> 00:01:53.500
 you can see it's laid out where it shows all your vpcs

39
00:01:53.500 --> 00:01:56.300
 for your account here. We only have one and this

40
00:01:56.300 --> 00:01:59.200
 one was created from Amazon when our account was set

41
00:01:59.200 --> 00:02:02.700
 up because you need a single default VPC when your

42
00:02:02.700 --> 00:02:03.500
 accounts created.

43
00:02:04.200 --> 00:02:07.000
Me open this up a little more so you can see the ID here. You have

44
00:02:07.600 --> 00:02:09.700
 a VPC ID. This is unique to this VPC.

45
00:02:10.500 --> 00:02:13.200
We can see the state it's available. And then here we

46
00:02:13.200 --> 00:02:16.900
 see the ipv4 side range. So this is the IP

47
00:02:16.900 --> 00:02:19.400
 address range that Amazon has provided for

48
00:02:19.400 --> 00:02:23.000
 this VPC. And as you can see here, it's a slash 16, which

49
00:02:22.200 --> 00:02:26.400
 means we have about 65,534 IP

50
00:02:25.400 --> 00:02:27.200
 addresses we can use

51
00:02:28.300 --> 00:02:31.600
All within this virtual Network, obviously you may

52
00:02:31.600 --> 00:02:34.000
 or may not use all of them. But you do have them there if you want

53
00:02:34.300 --> 00:02:37.400
 and I recommend you always take the slash 16 when creating a VPC.

54
00:02:38.300 --> 00:02:41.400
Over here we have this DHCP option. Basically what

55
00:02:41.400 --> 00:02:45.100
 this means for this VPC is that addresses will

56
00:02:44.100 --> 00:02:47.600
 be automatically given to Virtual instances when

57
00:02:47.600 --> 00:02:48.200
 they ask for it.

58
00:02:48.900 --> 00:02:51.500
So up here in the top, right you'll see orange button

59
00:02:51.500 --> 00:02:54.100
 that says create VPC and next to it.

60
00:02:54.100 --> 00:02:57.700
 There's an action buttons, which is dropdown. The create VPC

61
00:02:57.700 --> 00:03:00.300
 button is here how you would create your own VPC?

62
00:03:01.700 --> 00:03:04.200
From the AWS console. Obviously, we're not going to do that here

63
00:03:04.200 --> 00:03:07.100
 because we're going to use some terraform in a

64
00:03:07.100 --> 00:03:09.000
 later video to create our infrastructure for us.

65
00:03:09.800 --> 00:03:10.900
but if you wanted to edit

66
00:03:11.800 --> 00:03:14.500
a VPC or let's say delete a VPC you can

67
00:03:14.500 --> 00:03:17.300
 use this actions drop-down and select your

68
00:03:17.300 --> 00:03:18.500
 appropriate option there.

69
00:03:19.800 --> 00:03:22.200
So one thing that apis console provides you

70
00:03:22.200 --> 00:03:24.500
 also too is like kind of like a details drill down.

71
00:03:25.200 --> 00:03:28.300
And so if you click on the little checkbox right

72
00:03:28.300 --> 00:03:31.300
 there on the component you want to look at you can

73
00:03:31.300 --> 00:03:34.400
 see here. It opens up this other this Details page. It opens

74
00:03:34.400 --> 00:03:37.200
 up this details paint and here we see a bunch

75
00:03:37.200 --> 00:03:40.700
 of attributes and some tabs. You can click up here. There's a

76
00:03:40.700 --> 00:03:43.200
 lot going on here. We won't go into all of

77
00:03:43.200 --> 00:03:46.300
 it, but I want you to know where it is available if you wanted to

78
00:03:46.300 --> 00:03:46.600
 dive deeper.

79
00:03:47.300 --> 00:03:50.700
So the first thing we should talk about here is the tenancy and it's set

80
00:03:50.700 --> 00:03:53.700
 as default what this means is that this VPC

81
00:03:53.700 --> 00:03:56.300
 and all the resources inside are okay running

82
00:03:56.300 --> 00:03:59.700
 on shared hardware shared hardware means that multiple customers

83
00:03:59.700 --> 00:04:02.100
 can use the same physical hardware and obviously for

84
00:04:02.100 --> 00:04:03.600
 our use case. This is fine here.

85
00:04:04.500 --> 00:04:07.700
The other option which is important to discuss

86
00:04:07.700 --> 00:04:10.500
 here as well is that we have DNS host names

87
00:04:10.500 --> 00:04:11.100
 enabled.

88
00:04:11.800 --> 00:04:14.700
With this means is that if you had multiple virtual instances running

89
00:04:14.700 --> 00:04:17.900
 inside this VPC and they had

90
00:04:17.900 --> 00:04:20.600
 their own fully qualified domain name. You

91
00:04:20.600 --> 00:04:23.800
 can find you can reach the other

92
00:04:23.800 --> 00:04:26.500
 instance by just using the full qualified domain

93
00:04:26.500 --> 00:04:29.700
 name instead of just a regular IP address. This is

94
00:04:29.700 --> 00:04:31.300
 a good option to always turn on.

95
00:04:32.300 --> 00:04:35.500
Here, we already talked about the side range above and then the

96
00:04:35.500 --> 00:04:38.100
 DHCP option is set. The next thing we should talk about up here

97
00:04:38.100 --> 00:04:41.400
 is this tab is called resource map. So this is actually a new feature

98
00:04:41.400 --> 00:04:44.200
 that Amazon is implemented here and what this

99
00:04:44.200 --> 00:04:47.300
 basically does is shows you a relationship between all

100
00:04:47.300 --> 00:04:50.000
 your network components and

101
00:04:51.200 --> 00:04:55.000
you could see that the solid lines here represent relationships.

102
00:04:54.600 --> 00:04:58.000
 Whereas the dotted line Show Network traffic. This

103
00:04:57.100 --> 00:04:59.600
 is pretty handy if you wanted to see

104
00:05:00.400 --> 00:05:03.300
If you had everything set up, right or if your traffic

105
00:05:03.300 --> 00:05:04.600
 was flowing in there correct way.

106
00:05:05.300 --> 00:05:08.000
Is this cider tab here? And as we already talked about this is going to

107
00:05:08.100 --> 00:05:11.800
 be our slash 16 for all of our subnet here for the default ours

108
00:05:11.800 --> 00:05:13.900
 is gonna be a slash 16 as well when we create it.

109
00:05:14.700 --> 00:05:17.500
Here's the flow logs. This is great. If you need to capture

110
00:05:17.500 --> 00:05:21.200
 a network traffic in and out of your VPC based

111
00:05:20.200 --> 00:05:23.400
 on auditing purposes

112
00:05:23.400 --> 00:05:26.500
 or any anything else like compliance reasons and or

113
00:05:26.500 --> 00:05:30.000
 troubleshooting. This would be a good thing to have it tags are

114
00:05:29.300 --> 00:05:32.500
 great way to add a human

115
00:05:32.500 --> 00:05:35.400
 readable name or a group to some sort

116
00:05:35.400 --> 00:05:38.400
 of Amazon resource. This is really great. When you're looking for

117
00:05:38.400 --> 00:05:41.600
 things and you want to group like things together or have more

118
00:05:41.600 --> 00:05:44.300
 of a human readable name to it instead of these IDs which

119
00:05:44.300 --> 00:05:48.200
 obviously gonna be hard enough to remember. Okay. So

120
00:05:47.200 --> 00:05:50.800
 that is the basic overview of VPC inside

121
00:05:50.800 --> 00:05:53.200
 the AWS console now, we'll head back over

122
00:05:53.200 --> 00:05:56.200
 to the terminal and then let's look at the terraform Fallout actually create

123
00:05:56.200 --> 00:05:58.100
 all this one when that time comes for our lab.

124
00:05:59.300 --> 00:06:02.600
Okay, here we are inside the terminal. I am

125
00:06:02.600 --> 00:06:05.300
 inside the Clone repository that is

126
00:06:05.300 --> 00:06:08.700
 in the prerequisites for this course. If you haven't clone

127
00:06:08.700 --> 00:06:11.100
 the repository now now would be a good time to stop

128
00:06:11.100 --> 00:06:13.500
 the video and just go ahead and do that and come back.

129
00:06:14.600 --> 00:06:17.800
So inside this repository if

130
00:06:17.800 --> 00:06:21.200
 we take a look you can see that there's a lab terraform subdirectory.

131
00:06:20.200 --> 00:06:23.900
 This is going to have all of our infrastructure's code

132
00:06:23.900 --> 00:06:26.100
 files. So let's go ahead and go in there now.

133
00:06:28.800 --> 00:06:31.900
And let's go ahead and list all the files inside

134
00:06:31.900 --> 00:06:34.700
 of this directory as you

135
00:06:34.700 --> 00:06:37.200
 can see everything with terraform has

136
00:06:37.200 --> 00:06:38.400
 a DOT tfn to it.

137
00:06:39.100 --> 00:06:42.400
And that basically is the the files that we're

138
00:06:42.400 --> 00:06:45.200
 going to use to create the infrastructure for

139
00:06:45.200 --> 00:06:48.300
 our lab. But for this video, we're

140
00:06:48.300 --> 00:06:51.400
 just gonna Focus right now on the VPC terraform file.

141
00:06:51.400 --> 00:06:54.600
 So go ahead and open that up in your whatever editor you

142
00:06:54.600 --> 00:06:54.700
 like.

143
00:06:56.600 --> 00:06:59.700
And it's the vpc.tf file and let's

144
00:06:59.700 --> 00:07:03.200
 open this up. Okay, so as you can see terraform looks

145
00:07:03.800 --> 00:07:06.400
Kind of like any kind of program language. You probably

146
00:07:06.400 --> 00:07:09.100
 used to you have some curly braces. You've got

147
00:07:09.100 --> 00:07:09.300
 some.

148
00:07:10.100 --> 00:07:13.100
Equal declarations and you know, you've got some

149
00:07:13.100 --> 00:07:16.500
 structure here that to look at so the basic flow of

150
00:07:16.500 --> 00:07:19.600
 creating this module or creating

151
00:07:19.600 --> 00:07:22.800
 this resource if you will is this

152
00:07:22.800 --> 00:07:25.800
 declaration called resource right here and this is a terraform keyword.

153
00:07:26.600 --> 00:07:29.500
Here this this AWS VPC in the middle is

154
00:07:29.500 --> 00:07:32.300
 basically telling you that this is the library it's using

155
00:07:32.300 --> 00:07:35.200
 called AWS VPC. This Library knows how to

156
00:07:35.200 --> 00:07:38.500
 talk to Amazon and knows how to create a VPC and with

157
00:07:38.500 --> 00:07:41.300
 infrastructures code. You don't really care how it gets

158
00:07:41.300 --> 00:07:44.300
 done. You just want this as to be the state you end

159
00:07:44.300 --> 00:07:44.500
 up with.

160
00:07:45.500 --> 00:07:49.200
And here we just named this resource lab VPC, obviously

161
00:07:48.200 --> 00:07:51.600
 we want to be able to find this and they

162
00:07:51.600 --> 00:07:52.400
 use a human readable name.

163
00:07:53.700 --> 00:07:56.700
Here we set our cider block as you can tell this is a 10.0

164
00:07:56.700 --> 00:07:59.200
 instead of the 172 from the default. And this is

165
00:07:59.200 --> 00:08:03.600
 not by accident. You do not want to have overlapping

166
00:08:02.600 --> 00:08:05.500
 IP address ranges in separate

167
00:08:05.500 --> 00:08:08.700
 vpcs for obvious reasons. And so I'm

168
00:08:08.700 --> 00:08:11.300
 just using the 10.0 / 16 here.

169
00:08:11.300 --> 00:08:14.700
 So we get the full 65,534 addresses

170
00:08:14.700 --> 00:08:14.900
 to use.

171
00:08:15.900 --> 00:08:18.700
And if you remember in the AWS terminal on line

172
00:08:18.700 --> 00:08:21.000
 three here, we have enabled DNS host names.

173
00:08:21.800 --> 00:08:24.600
And we have this set to true as as

174
00:08:24.600 --> 00:08:27.400
 a native as console. We want to be able to find our virtual

175
00:08:27.400 --> 00:08:30.200
 instances by the fully qualified domain name if we wanted

176
00:08:30.200 --> 00:08:30.500
 to.

177
00:08:31.300 --> 00:08:34.600
Here on line four we have instance tenancy and here

178
00:08:34.600 --> 00:08:37.400
 it is default as well. Just like we saw in the default

179
00:08:37.400 --> 00:08:40.400
 VPC up in the console and obviously because

180
00:08:40.400 --> 00:08:42.400
 we're okay with being on shared hardware.

181
00:08:43.400 --> 00:08:46.200
So here is the tags where I was talking about. This is a really

182
00:08:46.200 --> 00:08:49.800
 good habit to get into is putting tags in all

183
00:08:49.800 --> 00:08:52.700
 your resources. So they're easy to find inside AWS and

184
00:08:52.700 --> 00:08:55.600
 here we set a key of name.

185
00:08:57.500 --> 00:09:00.400
And then the value lab -

186
00:09:00.400 --> 00:09:03.200
 VPC that name can be anything here. I just called it

187
00:09:03.200 --> 00:09:05.000
 lab VPC just so as easy to find.

188
00:09:06.300 --> 00:09:09.800
All right. So there's a quick brief overview of the terraform file

189
00:09:09.800 --> 00:09:12.800
 that will create our VPC in AWS moment

190
00:09:12.800 --> 00:09:13.800
 when it's time for our lab.

191
00:09:15.200 --> 00:09:18.500
For now, we're all set here. So just go ahead and close

192
00:09:18.500 --> 00:09:18.800
 the file.

193
00:09:19.700 --> 00:09:22.400
In this video you learned all about vpcs and

194
00:09:22.400 --> 00:09:25.700
 VPC features like subnets and routing you navigated to

195
00:09:25.700 --> 00:09:28.200
 the VPC console inside ws and you explore

196
00:09:28.200 --> 00:09:30.600
 the default VPC that AWS created for you.

197
00:09:31.600 --> 00:09:34.300
Finally you review the terraform file that will create

198
00:09:34.300 --> 00:09:35.800
 the VPC in your lab.

199
00:09:37.300 --> 00:09:40.900
In the next video, we will continue our path with AWS foundations

200
00:09:40.900 --> 00:09:43.100
 and learn what subnets and Route tables are.

201
00:09:44.300 --> 00:09:44.500
See you soon.
