From 0c9a7bf3339a16d63ac67805c992e2cbac86378e Mon Sep 17 00:00:00 2001 From: Renato Tavares Date: Thu, 4 Jul 2024 12:56:02 +1000 Subject: [PATCH] add aws_ec2_client_vpn_route (#29) Co-authored-by: Renato --- vpn-endpoint.tf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vpn-endpoint.tf b/vpn-endpoint.tf index e510547..e011c40 100644 --- a/vpn-endpoint.tf +++ b/vpn-endpoint.tf @@ -55,3 +55,11 @@ resource "aws_ec2_client_vpn_authorization_rule" "specific_groups" { target_network_cidr = element(var.allowed_cidr_ranges, count.index) access_group_id = var.allowed_access_groups[count.index % length(var.allowed_cidr_ranges)] } + + +resource "aws_ec2_client_vpn_route" "default" { + count = length(var.subnet_ids) * length(var.allowed_cidr_ranges) + client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.default.id + destination_cidr_block = element(var.allowed_cidr_ranges, count.index) + target_vpc_subnet_id = var.subnet_ids[count.index % length(var.subnet_ids)] +} \ No newline at end of file