terraform-aws-modules / terraform-aws-security-group

Terraform module to create AWS Security Group resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws
Other
563 stars 1.08k forks source link

adding tag\name for a rule #327

Open avishni01 opened 2 months ago

avishni01 commented 2 months ago

hello

i have just start using the module instead of creating with the basic terraform resources. it took me time to use it correctly , but one thing is missing (or maybe i didn't find how to do it), naming the SG rules. the name is actully bases on the tag Name, vurrntly in the default view all rules are displayed with empty name , there should be an option to add tags and name to for each rule.

FlorinAndrei commented 1 month ago

Yeah, there might be issues when names are conflicting with each other, but this would be very useful. I actually found this ticket because I was looking for a way to tag or describe the rules.

ScubaDrew commented 1 month ago

This module is not that great. Adding/Changing rules never works correctly either.

tigpt commented 2 weeks ago

I also wanted to add tags to the SG Rules, but looking at hashicorp/aws and hashicorp/awscc this is not exposed in api yet, so we can't do this for the module.

Looking forward to be able to track SG Rules with Tags to make sure every SG Rule is terraform and not clicksops.

robertalexa commented 1 week ago

According to documentation, it think it is just a case of using a different resource for rules https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule

Please note the first note: image

I interpret that as the module (this as well as others e.g. ecs) to drop the use of aws_security_group_rule and switch to aws_vpc_security_group_egress_rule and aws_vpc_security_group_ingress_rule respectively.

Wondering if maybe @antonbabenko or @bryantbiggs know anything on this or are tracking this on their roadmap already.