Skip to content

Commit

Permalink
Merge pull request #21 from clouddrove/issue-546
Browse files Browse the repository at this point in the history
fix: add security group module count
  • Loading branch information
13archit authored Sep 8, 2023
2 parents b6b320b + 608f7e7 commit 0414cfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ resource "aws_ec2_client_vpn_endpoint" "default" {
split_tunnel = var.split_tunnel_enable
vpc_id = var.vpc_id
session_timeout_hours = var.session_timeout_hours
security_group_ids = concat([aws_security_group.this.id], var.security_group_ids)
security_group_ids = concat([aws_security_group.this[0].id], var.security_group_ids)
vpn_port = var.vpn_port
self_service_portal = var.self_service_portal

Expand Down Expand Up @@ -200,6 +200,7 @@ resource "aws_ec2_client_vpn_endpoint" "default" {
#tfsec:ignore:aws-ec2-add-description-to-security-group
#tfsec:ignore:aws-ec2-add-description-to-security-group-rule
resource "aws_security_group" "this" {
count = var.enabled && var.enable_security_group ? 1 : 0
name_prefix = var.name
vpc_id = var.vpc_id
tags = module.labels.tags
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,9 @@ variable "security_group_egress" {
]
description = "List of maps of egress rules to set on the default security group"
}

variable "enable_security_group" {
type = bool
default = true
description = "create for security group module this value is enable 'true'"
}

0 comments on commit 0414cfe

Please sign in to comment.