-
Notifications
You must be signed in to change notification settings - Fork 4
/
aws_networking.tf
51 lines (42 loc) · 1.13 KB
/
aws_networking.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Terraform networking resources for AWS.
*/
resource "aws_vpc" "aws-vpc" {
depends_on = [equinix_ecx_l2_connection_accepter.aws]
cidr_block = var.aws_network_cidr
enable_dns_support = true
enable_dns_hostnames = true
tags = {
Name = format("%s-VPC", upper(var.owner))
Terraform = "true"
Project = lower(var.project_name)
Owner = lower(var.owner)
}
}
resource "aws_subnet" "aws-subnet-1" {
vpc_id = aws_vpc.aws-vpc.id
cidr_block = var.aws_subnet1_cidr
tags = {
Name = "aws-vpn-subnet"
Terraform = "true"
Project = lower(var.project_name)
Owner = lower(var.owner)
}
}
resource "aws_internet_gateway" "aws-vpc-igw" {
vpc_id = aws_vpc.aws-vpc.id
tags = {
Name = "aws-vpc-igw"
Terraform = "true"
Project = lower(var.project_name)
Owner = lower(var.owner)
}
}
resource "aws_default_route_table" "aws-vpc" {
default_route_table_id = aws_vpc.aws-vpc.default_route_table_id
route {
cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.aws-vpc-igw.id
}
propagating_vgws = [ aws_vpn_gateway.aws-dx.id ]
}