-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc_peering.tf
103 lines (85 loc) · 2.09 KB
/
vpc_peering.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* VPC Peering */
resource "aws_vpc_peering_connection" "core_bastion" {
peer_vpc_id = "${module.bastion.vpc_id}"
vpc_id = "${module.core.vpc_id}"
auto_accept = true
accepter {
allow_remote_vpc_dns_resolution = true
}
requester {
allow_remote_vpc_dns_resolution = true
}
tags {
Name = "${module.core.vpc_name}::${module.bastion.vpc_name}"
Department = "${var.owner}"
Environment = "Global"
Region = "${var.region["${var.buildenv}"]}"
Application = "shared"
Role = "networking"
Service = "vpc"
Category = "vpc.peering"
}
lifecycle {
create_before_destroy = true
}
depends_on = [
"module.bastion",
"module.core",
]
}
resource "aws_vpc_peering_connection" "core_app" {
peer_vpc_id = "${module.app.vpc_id}"
vpc_id = "${module.core.vpc_id}"
auto_accept = true
accepter {
allow_remote_vpc_dns_resolution = true
}
requester {
allow_remote_vpc_dns_resolution = true
}
tags {
Name = "${module.core.vpc_name}::${module.app.vpc_name}"
Department = "${var.owner}"
Environment = "Global"
Region = "${var.region["${var.buildenv}"]}"
Application = "shared"
Role = "networking"
Service = "vpc"
Category = "vpc.peering"
}
lifecycle {
create_before_destroy = true
}
depends_on = [
"module.app",
"module.core",
]
}
resource "aws_vpc_peering_connection" "bastion_app" {
peer_vpc_id = "${module.app.vpc_id}"
vpc_id = "${module.bastion.vpc_id}"
auto_accept = true
accepter {
allow_remote_vpc_dns_resolution = true
}
requester {
allow_remote_vpc_dns_resolution = true
}
tags {
Name = "${module.bastion.vpc_name}::${module.app.vpc_name}"
Department = "${var.owner}"
Environment = "Global"
Region = "${var.region["${var.buildenv}"]}"
Application = "shared"
Role = "networking"
Service = "vpc"
Category = "vpc.peering"
}
lifecycle {
create_before_destroy = true
}
depends_on = [
"module.bastion",
"module.app",
]
}