Create a VPC - Automation
In a previous blogpost we managed to manually create a simple VPC that could host several services or traditionnal EC2 instances. This process was quite simple using the AWS console as it would deploy all the network construct within a VPC (Subnets, Route Tables, Internet Gateways etc...)
I have been deploying network infrastructure (NSX, Cumulus, Cisco ...) for the past few years using Infrastructure as Code and naturally I will show you how to deploy networking cloud constructs related to AWS (not only !) using Terraform.
First, Terraform will need a way to authenticate with AWS (covered in this documentation, this AWS documentation is also very valuable).
There are plenty of examples on the Internet for this but the official terraform aws module is quite complete, it points to a GitHub repo that is very well presented and easy to follow.
My code for this particular deployment is very simple:
1
2provider "aws" {
3 shared_config_files = ["/Users/nmichel/.aws/config"]
4 shared_credentials_files = ["/Users/nmichel/.aws/credentials"]
5 #profile = "default"
6 region = "us-east-1"
7}
8
9locals {
10 name = "AWS-UE1-VPC-MGMT"
11 region = "us-east-1"
12 tags = {
13 Owner = "Nicolas MICHEL"
14 Environment = "IT Services"
15 #Name = "AWS-UE1-VPC-MGMT"
16 }
17}
18
19
20module "vpc" {
21 source = "terraform-aws-modules/vpc/aws"
22 version = "3.14.2"
23 name = "AWS-UE1-VPC-MGMT"
24 cidr = "10.0.10.0/24"
25
26 azs = ["${local.region}a", "${local.region}b"]
27 private_subnets = ["10.0.10.96/28", "10.0.10.112/28"]
28 public_subnets = ["10.0.10.0/28", "10.0.10.16/28"]
29
30 enable_nat_gateway = false
31 enable_vpn_gateway = false
32
33 manage_default_route_table = true
34 default_route_table_tags = { Name = "${local.name}-default" }
35
36
37 tags = local.tags
38}
39
40resource "aws_security_group" "allow_ssh" {
41 name = "SG-vPackets-MGMT"
42 description = "Allow SSH/HTTPS inbound traffic"
43 vpc_id = module.vpc.vpc_id
44 #vpc_id = aws_vpc.main.id
45
46 ingress {
47 description = "SSH from VPC"
48 from_port = 22
49 to_port = 22
50 protocol = "tcp"
51 cidr_blocks = ["YOUR_IP"]
52 #ipv6_cidr_blocks = [aws_vpc.main.ipv6_cidr_block]
53 }
54 ingress {
55 description = "TLS from VPC"
56 from_port = 443
57 to_port = 443
58 protocol = "tcp"
59 cidr_blocks = ["YOUR_IP"]
60 #ipv6_cidr_blocks = [aws_vpc.main.ipv6_cidr_block]
61 }
62
63 egress {
64 from_port = 0
65 to_port = 0
66 protocol = "-1"
67 cidr_blocks = ["0.0.0.0/0"]
68 ipv6_cidr_blocks = ["::/0"]
69 }
70
71 tags = {
72 Name = "SG-vPackets-MGMT"
73 }
74}
Same as previously it will create a simple VPC in 10 seconds and will allow me to install all my EC2 instances workloads. The only difference here is that I have included a Security Group that will allow inbound SSH and TLS traffic into EC2 instances linked with that Security Group. (please include your IP in the security group).
1$ terraform plan
2
3Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following
4symbols:
5 + create
6
7Terraform will perform the following actions:
8
9 # module.vpc.aws_default_route_table.default[0] will be created
10 + resource "aws_default_route_table" "default" {
11 + arn = (known after apply)
12 + default_route_table_id = (known after apply)
13 + id = (known after apply)
14 + owner_id = (known after apply)
15 + route = (known after apply)
16 + tags = {
17 + "Environment" = "IT Services"
18 + "Name" = "AWS-UE1-VPC-MGMT-default"
19 + "Owner" = "Nicolas MICHEL"
20 }
21 + tags_all = {
22 + "Environment" = "IT Services"
23 + "Name" = "AWS-UE1-VPC-MGMT-default"
24 + "Owner" = "Nicolas MICHEL"
25 }
26 + vpc_id = (known after apply)
27
28 + timeouts {
29 + create = "5m"
30 + update = "5m"
31 }
32 }
33
34 # module.vpc.aws_internet_gateway.this[0] will be created
35 + resource "aws_internet_gateway" "this" {
36 + arn = (known after apply)
37 + id = (known after apply)
38 + owner_id = (known after apply)
39 + tags = {
40 + "Environment" = "IT Services"
41 + "Name" = "AWS-UE1-VPC-MGMT"
42 + "Owner" = "Nicolas MICHEL"
43 }
44 + tags_all = {
45 + "Environment" = "IT Services"
46 + "Name" = "AWS-UE1-VPC-MGMT"
47 + "Owner" = "Nicolas MICHEL"
48 }
49 + vpc_id = (known after apply)
50 }
51
52 # module.vpc.aws_route.public_internet_gateway[0] will be created
53 + resource "aws_route" "public_internet_gateway" {
54 + destination_cidr_block = "0.0.0.0/0"
55 + gateway_id = (known after apply)
56 + id = (known after apply)
57 + instance_id = (known after apply)
58 + instance_owner_id = (known after apply)
59 + network_interface_id = (known after apply)
60 + origin = (known after apply)
61 + route_table_id = (known after apply)
62 + state = (known after apply)
63
64 + timeouts {
65 + create = "5m"
66 }
67 }
68
69 # module.vpc.aws_route_table.private[0] will be created
70 + resource "aws_route_table" "private" {
71 + arn = (known after apply)
72 + id = (known after apply)
73 + owner_id = (known after apply)
74 + propagating_vgws = (known after apply)
75 + route = (known after apply)
76 + tags = {
77 + "Environment" = "IT Services"
78 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
79 + "Owner" = "Nicolas MICHEL"
80 }
81 + tags_all = {
82 + "Environment" = "IT Services"
83 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
84 + "Owner" = "Nicolas MICHEL"
85 }
86 + vpc_id = (known after apply)
87 }
88
89 # module.vpc.aws_route_table.private[1] will be created
90 + resource "aws_route_table" "private" {
91 + arn = (known after apply)
92 + id = (known after apply)
93 + owner_id = (known after apply)
94 + propagating_vgws = (known after apply)
95 + route = (known after apply)
96 + tags = {
97 + "Environment" = "IT Services"
98 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
99 + "Owner" = "Nicolas MICHEL"
100 }
101 + tags_all = {
102 + "Environment" = "IT Services"
103 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
104 + "Owner" = "Nicolas MICHEL"
105 }
106 + vpc_id = (known after apply)
107 }
108
109 # module.vpc.aws_route_table.public[0] will be created
110 + resource "aws_route_table" "public" {
111 + arn = (known after apply)
112 + id = (known after apply)
113 + owner_id = (known after apply)
114 + propagating_vgws = (known after apply)
115 + route = (known after apply)
116 + tags = {
117 + "Environment" = "IT Services"
118 + "Name" = "AWS-UE1-VPC-MGMT-public"
119 + "Owner" = "Nicolas MICHEL"
120 }
121 + tags_all = {
122 + "Environment" = "IT Services"
123 + "Name" = "AWS-UE1-VPC-MGMT-public"
124 + "Owner" = "Nicolas MICHEL"
125 }
126 + vpc_id = (known after apply)
127 }
128
129 # module.vpc.aws_route_table_association.private[0] will be created
130 + resource "aws_route_table_association" "private" {
131 + id = (known after apply)
132 + route_table_id = (known after apply)
133 + subnet_id = (known after apply)
134 }
135
136 # module.vpc.aws_route_table_association.private[1] will be created
137 + resource "aws_route_table_association" "private" {
138 + id = (known after apply)
139 + route_table_id = (known after apply)
140 + subnet_id = (known after apply)
141 }
142
143 # module.vpc.aws_route_table_association.public[0] will be created
144 + resource "aws_route_table_association" "public" {
145 + id = (known after apply)
146 + route_table_id = (known after apply)
147 + subnet_id = (known after apply)
148 }
149
150 # module.vpc.aws_route_table_association.public[1] will be created
151 + resource "aws_route_table_association" "public" {
152 + id = (known after apply)
153 + route_table_id = (known after apply)
154 + subnet_id = (known after apply)
155 }
156
157 # module.vpc.aws_subnet.private[0] will be created
158 + resource "aws_subnet" "private" {
159 + arn = (known after apply)
160 + assign_ipv6_address_on_creation = false
161 + availability_zone = "us-east-1a"
162 + availability_zone_id = (known after apply)
163 + cidr_block = "10.0.10.96/28"
164 + enable_dns64 = false
165 + enable_resource_name_dns_a_record_on_launch = false
166 + enable_resource_name_dns_aaaa_record_on_launch = false
167 + id = (known after apply)
168 + ipv6_cidr_block_association_id = (known after apply)
169 + ipv6_native = false
170 + map_public_ip_on_launch = false
171 + owner_id = (known after apply)
172 + private_dns_hostname_type_on_launch = (known after apply)
173 + tags = {
174 + "Environment" = "IT Services"
175 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
176 + "Owner" = "Nicolas MICHEL"
177 }
178 + tags_all = {
179 + "Environment" = "IT Services"
180 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
181 + "Owner" = "Nicolas MICHEL"
182 }
183 + vpc_id = (known after apply)
184 }
185
186 # module.vpc.aws_subnet.private[1] will be created
187 + resource "aws_subnet" "private" {
188 + arn = (known after apply)
189 + assign_ipv6_address_on_creation = false
190 + availability_zone = "us-east-1b"
191 + availability_zone_id = (known after apply)
192 + cidr_block = "10.0.10.112/28"
193 + enable_dns64 = false
194 + enable_resource_name_dns_a_record_on_launch = false
195 + enable_resource_name_dns_aaaa_record_on_launch = false
196 + id = (known after apply)
197 + ipv6_cidr_block_association_id = (known after apply)
198 + ipv6_native = false
199 + map_public_ip_on_launch = false
200 + owner_id = (known after apply)
201 + private_dns_hostname_type_on_launch = (known after apply)
202 + tags = {
203 + "Environment" = "IT Services"
204 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
205 + "Owner" = "Nicolas MICHEL"
206 }
207 + tags_all = {
208 + "Environment" = "IT Services"
209 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
210 + "Owner" = "Nicolas MICHEL"
211 }
212 + vpc_id = (known after apply)
213 }
214
215 # module.vpc.aws_subnet.public[0] will be created
216 + resource "aws_subnet" "public" {
217 + arn = (known after apply)
218 + assign_ipv6_address_on_creation = false
219 + availability_zone = "us-east-1a"
220 + availability_zone_id = (known after apply)
221 + cidr_block = "10.0.10.0/28"
222 + enable_dns64 = false
223 + enable_resource_name_dns_a_record_on_launch = false
224 + enable_resource_name_dns_aaaa_record_on_launch = false
225 + id = (known after apply)
226 + ipv6_cidr_block_association_id = (known after apply)
227 + ipv6_native = false
228 + map_public_ip_on_launch = true
229 + owner_id = (known after apply)
230 + private_dns_hostname_type_on_launch = (known after apply)
231 + tags = {
232 + "Environment" = "IT Services"
233 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1a"
234 + "Owner" = "Nicolas MICHEL"
235 }
236 + tags_all = {
237 + "Environment" = "IT Services"
238 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1a"
239 + "Owner" = "Nicolas MICHEL"
240 }
241 + vpc_id = (known after apply)
242 }
243
244 # module.vpc.aws_subnet.public[1] will be created
245 + resource "aws_subnet" "public" {
246 + arn = (known after apply)
247 + assign_ipv6_address_on_creation = false
248 + availability_zone = "us-east-1b"
249 + availability_zone_id = (known after apply)
250 + cidr_block = "10.0.10.16/28"
251 + enable_dns64 = false
252 + enable_resource_name_dns_a_record_on_launch = false
253 + enable_resource_name_dns_aaaa_record_on_launch = false
254 + id = (known after apply)
255 + ipv6_cidr_block_association_id = (known after apply)
256 + ipv6_native = false
257 + map_public_ip_on_launch = true
258 + owner_id = (known after apply)
259 + private_dns_hostname_type_on_launch = (known after apply)
260 + tags = {
261 + "Environment" = "IT Services"
262 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1b"
263 + "Owner" = "Nicolas MICHEL"
264 }
265 + tags_all = {
266 + "Environment" = "IT Services"
267 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1b"
268 + "Owner" = "Nicolas MICHEL"
269 }
270 + vpc_id = (known after apply)
271 }
272
273 # module.vpc.aws_vpc.this[0] will be created
274 + resource "aws_vpc" "this" {
275 + arn = (known after apply)
276 + assign_generated_ipv6_cidr_block = false
277 + cidr_block = "10.0.10.0/24"
278 + default_network_acl_id = (known after apply)
279 + default_route_table_id = (known after apply)
280 + default_security_group_id = (known after apply)
281 + dhcp_options_id = (known after apply)
282 + enable_classiclink = (known after apply)
283 + enable_classiclink_dns_support = (known after apply)
284 + enable_dns_hostnames = false
285 + enable_dns_support = true
286 + id = (known after apply)
287 + instance_tenancy = "default"
288 + ipv6_association_id = (known after apply)
289 + ipv6_cidr_block = (known after apply)
290 + ipv6_cidr_block_network_border_group = (known after apply)
291 + main_route_table_id = (known after apply)
292 + owner_id = (known after apply)
293 + tags = {
294 + "Environment" = "IT Services"
295 + "Name" = "AWS-UE1-VPC-MGMT"
296 + "Owner" = "Nicolas MICHEL"
297 }
298 + tags_all = {
299 + "Environment" = "IT Services"
300 + "Name" = "AWS-UE1-VPC-MGMT"
301 + "Owner" = "Nicolas MICHEL"
302 }
303 }
304
305Plan: 15 to add, 0 to change, 0 to destroy.
306
307────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
308
309Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run
310"terraform apply" now.
Once you are ready to commit your configuration:
1$ terraform apply --auto-approve
2
3Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following
4symbols:
5 + create
6
7Terraform will perform the following actions:
8
9 # module.vpc.aws_default_route_table.default[0] will be created
10 + resource "aws_default_route_table" "default" {
11 + arn = (known after apply)
12 + default_route_table_id = (known after apply)
13 + id = (known after apply)
14 + owner_id = (known after apply)
15 + route = (known after apply)
16 + tags = {
17 + "Environment" = "IT Services"
18 + "Name" = "AWS-UE1-VPC-MGMT-default"
19 + "Owner" = "Nicolas MICHEL"
20 }
21 + tags_all = {
22 + "Environment" = "IT Services"
23 + "Name" = "AWS-UE1-VPC-MGMT-default"
24 + "Owner" = "Nicolas MICHEL"
25 }
26 + vpc_id = (known after apply)
27
28 + timeouts {
29 + create = "5m"
30 + update = "5m"
31 }
32 }
33
34 # module.vpc.aws_internet_gateway.this[0] will be created
35 + resource "aws_internet_gateway" "this" {
36 + arn = (known after apply)
37 + id = (known after apply)
38 + owner_id = (known after apply)
39 + tags = {
40 + "Environment" = "IT Services"
41 + "Name" = "AWS-UE1-VPC-MGMT"
42 + "Owner" = "Nicolas MICHEL"
43 }
44 + tags_all = {
45 + "Environment" = "IT Services"
46 + "Name" = "AWS-UE1-VPC-MGMT"
47 + "Owner" = "Nicolas MICHEL"
48 }
49 + vpc_id = (known after apply)
50 }
51
52 # module.vpc.aws_route.public_internet_gateway[0] will be created
53 + resource "aws_route" "public_internet_gateway" {
54 + destination_cidr_block = "0.0.0.0/0"
55 + gateway_id = (known after apply)
56 + id = (known after apply)
57 + instance_id = (known after apply)
58 + instance_owner_id = (known after apply)
59 + network_interface_id = (known after apply)
60 + origin = (known after apply)
61 + route_table_id = (known after apply)
62 + state = (known after apply)
63
64 + timeouts {
65 + create = "5m"
66 }
67 }
68
69 # module.vpc.aws_route_table.private[0] will be created
70 + resource "aws_route_table" "private" {
71 + arn = (known after apply)
72 + id = (known after apply)
73 + owner_id = (known after apply)
74 + propagating_vgws = (known after apply)
75 + route = (known after apply)
76 + tags = {
77 + "Environment" = "IT Services"
78 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
79 + "Owner" = "Nicolas MICHEL"
80 }
81 + tags_all = {
82 + "Environment" = "IT Services"
83 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
84 + "Owner" = "Nicolas MICHEL"
85 }
86 + vpc_id = (known after apply)
87 }
88
89 # module.vpc.aws_route_table.private[1] will be created
90 + resource "aws_route_table" "private" {
91 + arn = (known after apply)
92 + id = (known after apply)
93 + owner_id = (known after apply)
94 + propagating_vgws = (known after apply)
95 + route = (known after apply)
96 + tags = {
97 + "Environment" = "IT Services"
98 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
99 + "Owner" = "Nicolas MICHEL"
100 }
101 + tags_all = {
102 + "Environment" = "IT Services"
103 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
104 + "Owner" = "Nicolas MICHEL"
105 }
106 + vpc_id = (known after apply)
107 }
108
109 # module.vpc.aws_route_table.public[0] will be created
110 + resource "aws_route_table" "public" {
111 + arn = (known after apply)
112 + id = (known after apply)
113 + owner_id = (known after apply)
114 + propagating_vgws = (known after apply)
115 + route = (known after apply)
116 + tags = {
117 + "Environment" = "IT Services"
118 + "Name" = "AWS-UE1-VPC-MGMT-public"
119 + "Owner" = "Nicolas MICHEL"
120 }
121 + tags_all = {
122 + "Environment" = "IT Services"
123 + "Name" = "AWS-UE1-VPC-MGMT-public"
124 + "Owner" = "Nicolas MICHEL"
125 }
126 + vpc_id = (known after apply)
127 }
128
129 # module.vpc.aws_route_table_association.private[0] will be created
130 + resource "aws_route_table_association" "private" {
131 + id = (known after apply)
132 + route_table_id = (known after apply)
133 + subnet_id = (known after apply)
134 }
135
136 # module.vpc.aws_route_table_association.private[1] will be created
137 + resource "aws_route_table_association" "private" {
138 + id = (known after apply)
139 + route_table_id = (known after apply)
140 + subnet_id = (known after apply)
141 }
142
143 # module.vpc.aws_route_table_association.public[0] will be created
144 + resource "aws_route_table_association" "public" {
145 + id = (known after apply)
146 + route_table_id = (known after apply)
147 + subnet_id = (known after apply)
148 }
149
150 # module.vpc.aws_route_table_association.public[1] will be created
151 + resource "aws_route_table_association" "public" {
152 + id = (known after apply)
153 + route_table_id = (known after apply)
154 + subnet_id = (known after apply)
155 }
156
157 # module.vpc.aws_subnet.private[0] will be created
158 + resource "aws_subnet" "private" {
159 + arn = (known after apply)
160 + assign_ipv6_address_on_creation = false
161 + availability_zone = "us-east-1a"
162 + availability_zone_id = (known after apply)
163 + cidr_block = "10.0.10.96/28"
164 + enable_dns64 = false
165 + enable_resource_name_dns_a_record_on_launch = false
166 + enable_resource_name_dns_aaaa_record_on_launch = false
167 + id = (known after apply)
168 + ipv6_cidr_block_association_id = (known after apply)
169 + ipv6_native = false
170 + map_public_ip_on_launch = false
171 + owner_id = (known after apply)
172 + private_dns_hostname_type_on_launch = (known after apply)
173 + tags = {
174 + "Environment" = "IT Services"
175 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
176 + "Owner" = "Nicolas MICHEL"
177 }
178 + tags_all = {
179 + "Environment" = "IT Services"
180 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1a"
181 + "Owner" = "Nicolas MICHEL"
182 }
183 + vpc_id = (known after apply)
184 }
185
186 # module.vpc.aws_subnet.private[1] will be created
187 + resource "aws_subnet" "private" {
188 + arn = (known after apply)
189 + assign_ipv6_address_on_creation = false
190 + availability_zone = "us-east-1b"
191 + availability_zone_id = (known after apply)
192 + cidr_block = "10.0.10.112/28"
193 + enable_dns64 = false
194 + enable_resource_name_dns_a_record_on_launch = false
195 + enable_resource_name_dns_aaaa_record_on_launch = false
196 + id = (known after apply)
197 + ipv6_cidr_block_association_id = (known after apply)
198 + ipv6_native = false
199 + map_public_ip_on_launch = false
200 + owner_id = (known after apply)
201 + private_dns_hostname_type_on_launch = (known after apply)
202 + tags = {
203 + "Environment" = "IT Services"
204 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
205 + "Owner" = "Nicolas MICHEL"
206 }
207 + tags_all = {
208 + "Environment" = "IT Services"
209 + "Name" = "AWS-UE1-VPC-MGMT-private-us-east-1b"
210 + "Owner" = "Nicolas MICHEL"
211 }
212 + vpc_id = (known after apply)
213 }
214
215 # module.vpc.aws_subnet.public[0] will be created
216 + resource "aws_subnet" "public" {
217 + arn = (known after apply)
218 + assign_ipv6_address_on_creation = false
219 + availability_zone = "us-east-1a"
220 + availability_zone_id = (known after apply)
221 + cidr_block = "10.0.10.0/28"
222 + enable_dns64 = false
223 + enable_resource_name_dns_a_record_on_launch = false
224 + enable_resource_name_dns_aaaa_record_on_launch = false
225 + id = (known after apply)
226 + ipv6_cidr_block_association_id = (known after apply)
227 + ipv6_native = false
228 + map_public_ip_on_launch = true
229 + owner_id = (known after apply)
230 + private_dns_hostname_type_on_launch = (known after apply)
231 + tags = {
232 + "Environment" = "IT Services"
233 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1a"
234 + "Owner" = "Nicolas MICHEL"
235 }
236 + tags_all = {
237 + "Environment" = "IT Services"
238 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1a"
239 + "Owner" = "Nicolas MICHEL"
240 }
241 + vpc_id = (known after apply)
242 }
243
244 # module.vpc.aws_subnet.public[1] will be created
245 + resource "aws_subnet" "public" {
246 + arn = (known after apply)
247 + assign_ipv6_address_on_creation = false
248 + availability_zone = "us-east-1b"
249 + availability_zone_id = (known after apply)
250 + cidr_block = "10.0.10.16/28"
251 + enable_dns64 = false
252 + enable_resource_name_dns_a_record_on_launch = false
253 + enable_resource_name_dns_aaaa_record_on_launch = false
254 + id = (known after apply)
255 + ipv6_cidr_block_association_id = (known after apply)
256 + ipv6_native = false
257 + map_public_ip_on_launch = true
258 + owner_id = (known after apply)
259 + private_dns_hostname_type_on_launch = (known after apply)
260 + tags = {
261 + "Environment" = "IT Services"
262 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1b"
263 + "Owner" = "Nicolas MICHEL"
264 }
265 + tags_all = {
266 + "Environment" = "IT Services"
267 + "Name" = "AWS-UE1-VPC-MGMT-public-us-east-1b"
268 + "Owner" = "Nicolas MICHEL"
269 }
270 + vpc_id = (known after apply)
271 }
272
273 # module.vpc.aws_vpc.this[0] will be created
274 + resource "aws_vpc" "this" {
275 + arn = (known after apply)
276 + assign_generated_ipv6_cidr_block = false
277 + cidr_block = "10.0.10.0/24"
278 + default_network_acl_id = (known after apply)
279 + default_route_table_id = (known after apply)
280 + default_security_group_id = (known after apply)
281 + dhcp_options_id = (known after apply)
282 + enable_classiclink = (known after apply)
283 + enable_classiclink_dns_support = (known after apply)
284 + enable_dns_hostnames = false
285 + enable_dns_support = true
286 + id = (known after apply)
287 + instance_tenancy = "default"
288 + ipv6_association_id = (known after apply)
289 + ipv6_cidr_block = (known after apply)
290 + ipv6_cidr_block_network_border_group = (known after apply)
291 + main_route_table_id = (known after apply)
292 + owner_id = (known after apply)
293 + tags = {
294 + "Environment" = "IT Services"
295 + "Name" = "AWS-UE1-VPC-MGMT"
296 + "Owner" = "Nicolas MICHEL"
297 }
298 + tags_all = {
299 + "Environment" = "IT Services"
300 + "Name" = "AWS-UE1-VPC-MGMT"
301 + "Owner" = "Nicolas MICHEL"
302 }
303 }
304
305Plan: 15 to add, 0 to change, 0 to destroy.
306module.vpc.aws_vpc.this[0]: Creating...
307module.vpc.aws_vpc.this[0]: Creation complete after 2s [id=vpc-0d69b9d9d035a3211]
308module.vpc.aws_internet_gateway.this[0]: Creating...
309module.vpc.aws_route_table.private[1]: Creating...
310module.vpc.aws_default_route_table.default[0]: Creating...
311module.vpc.aws_subnet.private[0]: Creating...
312module.vpc.aws_subnet.private[1]: Creating...
313module.vpc.aws_route_table.private[0]: Creating...
314module.vpc.aws_subnet.public[1]: Creating...
315module.vpc.aws_subnet.public[0]: Creating...
316module.vpc.aws_route_table.public[0]: Creating...
317module.vpc.aws_default_route_table.default[0]: Creation complete after 0s [id=rtb-013e6bb525838db79]
318module.vpc.aws_internet_gateway.this[0]: Creation complete after 1s [id=igw-0b0e542cb990236bb]
319module.vpc.aws_route_table.private[1]: Creation complete after 1s [id=rtb-04bbfcd5698ba09b1]
320module.vpc.aws_subnet.private[1]: Creation complete after 1s [id=subnet-045c21dd73cb6b884]
321module.vpc.aws_route_table.public[0]: Creation complete after 1s [id=rtb-0ea1ec6dfcda17cfb]
322module.vpc.aws_route.public_internet_gateway[0]: Creating...
323module.vpc.aws_route_table.private[0]: Creation complete after 1s [id=rtb-0621af979022ced9e]
324module.vpc.aws_subnet.private[0]: Creation complete after 1s [id=subnet-0ea8623065f7d1ad8]
325module.vpc.aws_route_table_association.private[1]: Creating...
326module.vpc.aws_route_table_association.private[0]: Creating...
327module.vpc.aws_route.public_internet_gateway[0]: Creation complete after 0s [id=r-rtb-0ea1ec6dfcda17cfb1080289494]
328module.vpc.aws_route_table_association.private[1]: Creation complete after 0s [id=rtbassoc-0004ba062692cf374]
329module.vpc.aws_route_table_association.private[0]: Creation complete after 0s [id=rtbassoc-000104d5c187f0447]
330module.vpc.aws_subnet.public[1]: Still creating... [10s elapsed]
331module.vpc.aws_subnet.public[0]: Still creating... [10s elapsed]
332module.vpc.aws_subnet.public[0]: Creation complete after 11s [id=subnet-091fc97a306565841]
333module.vpc.aws_subnet.public[1]: Creation complete after 11s [id=subnet-028328f18f4e7abca]
334module.vpc.aws_route_table_association.public[0]: Creating...
335module.vpc.aws_route_table_association.public[1]: Creating...
336module.vpc.aws_route_table_association.public[0]: Creation complete after 1s [id=rtbassoc-070ed95b691a0a6dc]
337module.vpc.aws_route_table_association.public[1]: Creation complete after 1s [id=rtbassoc-026c58be638f03aaa]
338
339Apply complete! Resources: 15 added, 0 changed, 0 destroyed.
And voila ! The last lines in the outputs are the most important and will show you the networks constructs created !