Skip to content

Commit

Permalink
feat: Add security_groups var for mounted targets
Browse files Browse the repository at this point in the history
  • Loading branch information
yiskaneto committed Dec 6, 2024
1 parent be2b7c7 commit ce93a76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ resource "aws_efs_mount_target" "this" {

file_system_id = aws_efs_file_system.this[0].id
ip_address = try(each.value.ip_address, null)
security_groups = var.create_security_group ? concat([aws_security_group.this[0].id], try(each.value.security_groups, [])) : try(each.value.security_groups, null)
security_groups = var.create_security_group ? concat([aws_security_group.this[0].id], try(each.value.security_groups, [])) : try(each.value.security_groups, var.security_groups)
subnet_id = each.value.subnet_id
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ variable "mount_targets" {
default = {}
}

variable "security_groups" {
description = "(Optional) A list of up to 5 VPC security group IDs (that must be for the same VPC as subnet specified) in effect for the mount target."
type = list(string)
default = null
}

################################################################################
# Security Group
################################################################################
Expand Down

0 comments on commit ce93a76

Please sign in to comment.