File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ resource "aws_ec2_client_vpn_endpoint" "default" {
168
168
split_tunnel = var. split_tunnel_enable
169
169
vpc_id = var. vpc_id
170
170
session_timeout_hours = var. session_timeout_hours
171
- security_group_ids = concat ([aws_security_group . this . id ], var. security_group_ids )
171
+ security_group_ids = concat ([aws_security_group . this [ 0 ] . id ], var. security_group_ids )
172
172
vpn_port = var. vpn_port
173
173
self_service_portal = var. self_service_portal
174
174
@@ -200,6 +200,7 @@ resource "aws_ec2_client_vpn_endpoint" "default" {
200
200
# tfsec:ignore:aws-ec2-add-description-to-security-group
201
201
# tfsec:ignore:aws-ec2-add-description-to-security-group-rule
202
202
resource "aws_security_group" "this" {
203
+ count = var. enabled && var. enable_security_group ? 1 : 0
203
204
name_prefix = var. name
204
205
vpc_id = var. vpc_id
205
206
tags = module. labels . tags
Original file line number Diff line number Diff line change @@ -214,3 +214,9 @@ variable "security_group_egress" {
214
214
]
215
215
description = " List of maps of egress rules to set on the default security group"
216
216
}
217
+
218
+ variable "enable_security_group" {
219
+ type = bool
220
+ default = true
221
+ description = " create for security group module this value is enable 'true'"
222
+ }
You can’t perform that action at this time.
0 commit comments