Last active
December 16, 2017 17:46
-
-
Save oogali/87b2b9cce3de2c1645e9c6cbee87547e to your computer and use it in GitHub Desktop.
Just waiting on Terraform AWS provider to support inter-region VPC peering...
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
# Pending apply... needs https://github.com/terraform-providers/terraform-provider-aws/issues/2484 | |
# | |
resource "aws_vpc_peering_connection" "north-virginia-to-ohio" { | |
provider = "aws.us-east-1" | |
vpc_id = "${module.us-north-virginia.vpc_id}" | |
peer_region = "us-east-2" | |
peer_vpc_id = "${module.us-ohio.vpc_id}" | |
accepter { | |
allow_remote_vpc_dns_resolution = true | |
} | |
requester { | |
allow_remote_vpc_dns_resolution = true | |
} | |
tags { | |
Name = "North Virginia-Ohio VPC Peering Connection" | |
} | |
} | |
resource "aws_vpc_peering_connection" "ohio-to-north-virginia" { | |
provider = "aws.us-east-2" | |
vpc_id = "${module.us-ohio.vpc_id}" | |
peer_region = "us-east-1" | |
peer_vpc_id = "${module.us-north-virginia.vpc_id}" | |
accepter { | |
allow_remote_vpc_dns_resolution = true | |
} | |
requester { | |
allow_remote_vpc_dns_resolution = true | |
} | |
tags { | |
Name = "North Virginia-Ohio VPC Peering Connection" | |
} | |
} | |
resource "aws_route" "north-virginia-to-ohio" { | |
provider = "aws.us-east-1" | |
vpc_id = "${module.us-north-virginia.vpc_id}" | |
route_table_id = "${module.us-north-virginia.vpc_routing_table}" | |
destination_cidr_block = "${var.aws-ohio-cidr-block}" | |
vpc_peering_connection_id = "${aws_vpc_peering_connection.north-virginia-to-ohio.id}" | |
} | |
resource "aws_route" "ohio-to-north-virginia" { | |
provider = "aws.us-east-2" | |
vpc_id = "${module.us-ohio.vpc_id}" | |
route_table_id = "${module.us-ohio.vpc_routing_table}" | |
destination_cidr_block = "${var.aws-north-virginia-cidr-block}" | |
vpc_peering_connection_id = "${aws_vpc_peering_connection.ohio-to-north-virginia.id}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment