Skip to content

Commit 0943066

Browse files
authored
Merge pull request #2 from tedivm/optional_security_groups
Ability to specify additional security groups
2 parents 08b1851 + 6c5bc85 commit 0943066

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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
2526
resource "local_file" "client_config" {

network.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
1217
variable "tags" {
1318
default = {}
1419
}

0 commit comments

Comments
 (0)