Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add security group module count #21

Merged
merged 1 commit into from
Sep 8, 2023
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
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'"
}