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