-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprivate.tf
72 lines (60 loc) · 2.12 KB
/
private.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
resource "aws_route_table" "rt_private_a" {
vpc_id = aws_vpc.amc-vpc.id
tags = merge(var.tags, {})
}
resource "aws_route_table_association" "rt_assoc_private_a" {
subnet_id = aws_subnet.private_a.id
route_table_id = aws_route_table.rt_private_a.id
}
resource "aws_route" "route_pa" {
route_table_id = aws_route_table.rt_private_a.id
destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = aws_nat_gateway.nat-gw-2a-public.id
}
resource "aws_route_table" "rt_private_b" {
vpc_id = aws_vpc.amc-vpc.id
tags = merge(var.tags, {})
}
resource "aws_route_table_association" "rt_assoc_private_b" {
subnet_id = aws_subnet.private_b.id
route_table_id = aws_route_table.rt_private_b.id
}
resource "aws_route" "route_pb" {
route_table_id = aws_route_table.rt_private_b.id
destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = aws_nat_gateway.nat-gw-2b-public.id
}
resource "aws_route_table" "rt_private_c" {
vpc_id = aws_vpc.amc-vpc.id
tags = merge(var.tags, {})
}
resource "aws_route_table_association" "rt_assoc_private_c" {
subnet_id = aws_subnet.private_c.id
route_table_id = aws_route_table.rt_private_c.id
}
resource "aws_route" "route_pc" {
route_table_id = aws_route_table.rt_private_c.id
destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = aws_nat_gateway.nat-gw-2c-public.id
}
resource "aws_subnet" "private_a" {
vpc_id = aws_vpc.amc-vpc.id
tags = merge(var.tags, {})
map_public_ip_on_launch = false
cidr_block = var.private_subnets.a
availability_zone = "us-east-2a"
}
resource "aws_subnet" "private_b" {
vpc_id = aws_vpc.amc-vpc.id
tags = merge(var.tags, {})
map_public_ip_on_launch = false
cidr_block = var.private_subnets.b
availability_zone = "us-east-2b"
}
resource "aws_subnet" "private_c" {
vpc_id = aws_vpc.amc-vpc.id
tags = merge(var.tags, {})
map_public_ip_on_launch = false
cidr_block = var.private_subnets.c
availability_zone = "us-east-2c"
}