Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ module "vpn" {
source = "tedivm/dev-vpn/aws"
version = "~> 1.0"

identifier = "${local.identifier}-vpn"
subnet_ids = module.vpc.subnets.public[*].id
tags = local.common_tags
identifier = "${local.identifier}-vpn"
subnet_ids = module.vpc.subnets.public[*].id
security_group_ids = [aws_security_group.optional.id]
tags = local.common_tags
}

resource "local_file" "client_config" {
Expand Down
2 changes: 1 addition & 1 deletion network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "aws_ec2_client_vpn_network_association" "vpn_subnets" {

client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.vpn.id
subnet_id = var.subnet_ids[count.index]
security_groups = [aws_security_group.vpn_access.id]
security_groups = concat([aws_security_group.vpn_access.id], var.security_group_ids)

lifecycle {
# This is a bug workaround- https://github.com/hashicorp/terraform-provider-aws/issues/14717
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ variable "subnet_ids" {
type = list(string)
}

variable "security_group_ids" {
description = "Additional Security Groups to add to the VPN endpoint."
default = []
}

variable "tags" {
default = {}
}
Expand Down