File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ module "vpn" {
1717 source = "tedivm/dev-vpn/aws"
1818 version = "~> 1.0"
1919
20- identifier = "${local.identifier}-vpn"
21- subnet_ids = module.vpc.subnets.public[*].id
22- tags = local.common_tags
20+ identifier = "${local.identifier}-vpn"
21+ subnet_ids = module.vpc.subnets.public[*].id
22+ security_group_ids = [aws_security_group.optional.id]
23+ tags = local.common_tags
2324}
2425
2526resource "local_file" "client_config" {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ resource "aws_ec2_client_vpn_network_association" "vpn_subnets" {
44
55 client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint. vpn . id
66 subnet_id = var. subnet_ids [count . index ]
7- security_groups = [aws_security_group . vpn_access . id ]
7+ security_groups = concat ( [aws_security_group . vpn_access . id ], var . security_group_ids )
88
99 lifecycle {
1010 # This is a bug workaround- https://github.com/hashicorp/terraform-provider-aws/issues/14717
Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ variable "subnet_ids" {
99 type = list (string )
1010}
1111
12+ variable "security_group_ids" {
13+ description = " Additional Security Groups to add to the VPN endpoint."
14+ default = []
15+ }
16+
1217variable "tags" {
1318 default = {}
1419}
You can’t perform that action at this time.
0 commit comments