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

Not able to add existing security groups to aws_efs_mount_target #36

Open
yiskaneto opened this issue Dec 6, 2024 · 2 comments
Open

Comments

@yiskaneto
Copy link

Is your request related to a new offering from AWS?

Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.

  • Yes ✅: please list the AWS provider version which introduced this functionality

I couldn't find the version but in short, it uses the security_groups attribute from https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/efs_mount_target

Is your request related to a problem? Please describe.

There are times when we need to pass an existing security group to the aws_efs_mount_target resource, currently this is not possibly with this module.

Describe the solution you'd like.

Create a new variable security_groups and add it as part of the logic taken on https://github.com/terraform-aws-modules/terraform-aws-efs/blob/master/main.tf#L149

@bryantbiggs
Copy link
Member

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]
    }
  }

Share a reproduction of what you are trying and details on whats not working

@churtado-tech
Copy link

churtado-tech commented Dec 19, 2024

In addition with example attached in repo if you want to use maping with current subnets id list.

`{ for k, v in zipmap(var.vpc_azs, var.private_subnet_ids) : k => { subnet_id = v
    security_groups = [var.eks_security_group]`

Anyway, if you want to combine Custom Security group (Create a new one) and attach another SG is not allowed, no?
Or use custom Security group and attach sg with rules.

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 a pull request may close this issue.

3 participants