-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvpc-peering.tf.test
49 lines (45 loc) · 1.32 KB
/
vpc-peering.tf.test
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
/*
VPC Peering
*/
data "aws_caller_identity" "current" {
}
resource "aws_vpc_peering_connection" "vpc-omn-dev" {
peer_owner_id = "${resource.aws_caller_identity.current.account_id}"
peer_vpc_id = "${var.vpc_omn_dev}"
vpc_id = "${aws_vpc.vpc.id}"
auto_accept = true
tags {
Name = "acc-stack_omn-dev"
}
}
resource "aws_vpc_peering_connection" "vpc-omn-qa" {
peer_owner_id = "${resource.aws_caller_identity.current.account_id}"
peer_vpc_id = "${var.vpc_omn_qa}"
vpc_id = "${aws_vpc.vpc.id}"
auto_accept = true
tags {
Name = "acc-stack_omn-qa"
}
}
resource "aws_vpc_peering_connection" "vpc-apollo-dev" {
peer_owner_id = "${resource.aws_caller_identity.current.account_id}"
peer_vpc_id = "${var.vpc_apollo_dev}"
vpc_id = "${aws_vpc.vpc.id}"
auto_accept = true
tags {
Name = "acc-stack_apollo-dev"
}
}
resource "aws_vpc_peering_connection" "vpc-apollo-qa" {
peer_owner_id = "${resource.aws_caller_identity.current.account_id}"
peer_vpc_id = "${var.vpc_apollo_dev}"
vpc_id = "${aws_vpc.vpc.id}"
auto_accept = true
tags {
Name = "acc-stack_apollo-qa"
}
}
resource "aws_route" "vpc-route-peering" {
route_table_id = "${aws_route_table.rtb-pub.id}"
destination_cidr_block = "${cidrsubnet(data.aws_vpc.var.vpc_omn_dev.cidr_block, 4, 1)}"
}