Associates a VPN Gateway with a Direct Connect Gateway and configures allowed prefixes for network traffic.

Terraform Template

resource "aws_dx_gateway" "example" {
  amazon_side_asn = "64512"
  name = "example"
}

resource "aws_dx_gateway_association" "example" {
  allowed_prefixes = ["210.52.109.0/24", "175.45.176.0/22"]
  associated_gateway_id = aws_vpn_gateway.example.id
  dx_gateway_id = aws_dx_gateway.example.id
}

resource "aws_vpc" "example" {
  cidr_block = "10.255.255.0/28"
}

resource "aws_vpn_gateway" "example" {
  vpc_id = aws_vpc.example.id
}