Skip to content

Conversation

@armanzeroeight
Copy link
Contributor

Description

We should used the already computed local.security_group_name instead of var.name in security group rule name tag.

Motivation and Context

Its safer to use the local so if the user has decided to set a different name on SG than the EC2 stack.

security_group_name   = try(coalesce(var.security_group_name, var.name), "")

We are already using it for the SG name tag:

 tags = merge(
    var.tags,
    { "Name" = local.security_group_name },
    var.security_group_tags
  )

but not on the rules. This will harmonize that too.

Breaking Changes

No breaking changes

@armanzeroeight armanzeroeight changed the title Use computed local var in sg rule name fix: Use computed local var in sg rule name Oct 14, 2025
@bryantbiggs bryantbiggs changed the title fix: Use computed local var in sg rule name fix: Use computed local.security_group_name in the security group Name tag Oct 14, 2025
@bryantbiggs bryantbiggs merged commit 541cc3d into terraform-aws-modules:master Oct 14, 2025
8 of 9 checks passed
antonbabenko pushed a commit that referenced this pull request Oct 14, 2025
## [6.1.2](v6.1.1...v6.1.2) (2025-10-14)

### Bug Fixes

* Use computed `local.security_group_name` in the security group `Name` tag ([#458](#458)) ([541cc3d](541cc3d))
@antonbabenko
Copy link
Member

This PR is included in version 6.1.2 🎉

@armanzeroeight armanzeroeight deleted the feature/fix-sg-rules-tags branch October 14, 2025 13:57
@armanzeroeight
Copy link
Contributor Author

Cool @antonbabenko and @bryantbiggs 🥇

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants