Skip to content

Commit

Permalink
Merge pull request #18 from zelch/master
Browse files Browse the repository at this point in the history
Don't set peering options for cross-region.
  • Loading branch information
grem11n committed Jun 20, 2019
2 parents 4730cea + 5212271 commit 61e1e50
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ resource "aws_vpc_peering_connection_options" "this" {
provider = "aws.this"
vpc_peering_connection_id = aws_vpc_peering_connection_accepter.peer_accepter.id

# See https://github.com/terraform-providers/terraform-provider-aws/issues/6730
# Until this is fixed, we must not try and set any options for cross-region peering.
count = "${data.aws_region.this.name == data.aws_region.peer.name ? 1 : 0}"

requester {
allow_remote_vpc_dns_resolution = var.this_dns_resolution
allow_classic_link_to_remote_vpc = var.this_link_to_peer_classic
Expand All @@ -44,10 +48,13 @@ resource "aws_vpc_peering_connection_options" "this" {
}

resource "aws_vpc_peering_connection_options" "accepter" {
provider = "aws.peer"

provider = "aws.peer"
vpc_peering_connection_id = aws_vpc_peering_connection_accepter.peer_accepter.id

# See https://github.com/terraform-providers/terraform-provider-aws/issues/6730
# Until this is fixed, we must not try and set any options for cross-region peering.
count = "${data.aws_region.this.name == data.aws_region.peer.name ? 1 : 0}"

accepter {
allow_remote_vpc_dns_resolution = var.peer_dns_resolution
allow_classic_link_to_remote_vpc = var.peer_link_to_peer_classic
Expand Down

0 comments on commit 61e1e50

Please sign in to comment.