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

fix: Allow for override of Name tag on load balancer #262

Conversation

mjmayer
Copy link
Contributor

@mjmayer mjmayer commented Oct 6, 2022

Description

Changes the order of merge() on the tags to allow override of the Name tag.

Motivation and Context

I prefer to use name_prefix when creating load balancers. This ensures all the load balancers are created with unique names. However, it becomes difficult to determine which load balancer I am viewing in the AWS console because they are start with the same prefix. The only way to see which one I am looking at is to review the rules.

My solution is to use a Name tag passed into the variable lb_tags. This module currently overrides any Name tag I pass with the value of name_prefix. By changing the order of the merge() on the tags, the module can still set Name if it is not passed in, but won't override it if it is.

This PR is loosely related to #52.

Breaking Changes

There is no breaking changes in this PR.

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 deployed a load balancer using this module, version 8.1, with lb_tags = { "Name" = "MyLoadBalancer" } and the name_prefix = "mylb-". After I deployed the load balancer, the Name tag was defined as mylb-. I switched the module source in my terraform to use my feature branch and ran terraform apply. The Name tag was updated to MyLoadBalancer

  • I have executed pre-commit run -a on my pull request

@mjmayer mjmayer changed the title Allow for override of Name tag on load balancer fix: Allow for override of Name tag on load balancer Oct 6, 2022
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!

@antonbabenko antonbabenko merged commit 40d10dd into terraform-aws-modules:master Oct 28, 2022
antonbabenko pushed a commit that referenced this pull request Oct 28, 2022
### [8.1.2](v8.1.1...v8.1.2) (2022-10-28)

### Bug Fixes

* Allow for override of Name tag on load balancer ([#262](#262)) ([40d10dd](40d10dd))
@antonbabenko
Copy link
Member

This PR is included in version 8.1.2 🎉

@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 28, 2022
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.

2 participants