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

feat: Add security_groups var for mounted targets #37

Conversation

yiskaneto
Copy link

@yiskaneto yiskaneto commented Dec 6, 2024

Description

Fixes: #36

Motivation and Context

Changes need to pass existing security groups

Breaking Changes

NA

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@yiskaneto
Copy link
Author

pending: update example/*

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already support this via the each.value.security_groups shown above

so in your mount targets:

  # Truncated for brevity
  mount_targets = {
    one = {
      security_groups = [ #add them here]
    }
  }

@bryantbiggs bryantbiggs closed this Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not able to add existing security groups to aws_efs_mount_target
2 participants