Skip to content

Commit

Permalink
PM-9999: create route from peer to primary for a list of route tables (
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelYefet1 authored Dec 28, 2023
1 parent 12b2d7a commit ef7f07b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ variable "vpc_group" { type = object({
external_accepter = bool
aws_region = string
vpc_id = string
rtbl_id = optional(string, "")
rtbl_ids = optional(list(string), [])
account_id = string
cidr_block = string
assume_role = optional(string, "")
Expand Down
4 changes: 2 additions & 2 deletions vpc/routes/vpc_peering/vpc_peering.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ resource "aws_vpc_peering_connection_accepter" "peer-vpc" {
*/
resource "aws_route" "peer2primary" {
provider = aws.peer_vpc
route_table_id = var.peer_vpc["rtbl_id"]
route_table_id = element(var.peer_vpc["rtbl_ids"], count.index)
destination_cidr_block = var.vpc_cidr_block
vpc_peering_connection_id = aws_vpc_peering_connection.primary2peer.id
count = /* var.peer_vpc["create_peering"] && */ (! var.peer_vpc["external_accepter"])? 1 : 0
count = /* var.peer_vpc["create_peering"] && */ (! var.peer_vpc["external_accepter"])? length(var.peer_vpc["rtbl_ids"]) : 0
}

/**
Expand Down

0 comments on commit ef7f07b

Please sign in to comment.