Created
March 14, 2019 04:17
-
-
Save 100daysofdevops/b735bcbb7dbd9a4ca726449df5f4ba07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_vpc_peering_connection" "test-vpc" { | |
| peer_vpc_id = "${var.secondary_vpc_id}" | |
| vpc_id = "${var.primary_vpc_id}" | |
| auto_accept = true | |
| tags { | |
| Name = "my-vpc-peering" | |
| } | |
| } | |
| resource "aws_route" "vpc1-to-vpc2" { | |
| route_table_id = "${var.vpc1_route_id}" | |
| destination_cidr_block = "${var.vpc2_cidr_block}" | |
| vpc_peering_connection_id = "${aws_vpc_peering_connection.test-vpc.id}" | |
| } | |
| resource "aws_route" "vpc2-to-vpc1" { | |
| route_table_id = "${var.vpc2_route_id}" | |
| destination_cidr_block = "${var.vpc1_cidr_block}" | |
| vpc_peering_connection_id = "${aws_vpc_peering_connection.test-vpc.id}" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment