Skip to content

Commit

Permalink
Merge pull request #14 from BorisLabs/add-allowed-prefixes
Browse files Browse the repository at this point in the history
feat: Add ability to pass allowed prefixes into DX GW association.
  • Loading branch information
JoshiiSinfield authored Sep 14, 2023
2 parents 93cc20c + 3e0ec6f commit 0c2ac4f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ resource "aws_dx_gateway_association" "this" {

dx_gateway_id = aws_dx_gateway.this[0].id
associated_gateway_id = concat(aws_vpn_gateway.this.*.id[0], [var.vgw_id])[0]

allowed_prefixes = var.allowed_prefixes
}

resource "aws_dx_gateway_association" "cross_account" {
Expand All @@ -111,6 +113,8 @@ resource "aws_dx_gateway_association" "cross_account" {
dx_gateway_id = var.dx_gateway_id
proposal_id = aws_dx_gateway_association_proposal.this.*.id[0]
associated_gateway_owner_account_id = data.aws_caller_identity.this.account_id

allowed_prefixes = var.allowed_prefixes
}

resource "aws_dx_gateway_association_proposal" "this" {
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -449,3 +449,10 @@ variable "dx_bgp_customer_address" {

type = string
}

variable "allowed_prefixes" {
description = "List of allowed prefixes to advertise to the Direct Connect Gateway"
default = null

type = set(string)
}

0 comments on commit 0c2ac4f

Please sign in to comment.