fix: Allow for override of Name tag on load balancer #262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes the order of
merge()
on the tags to allow override of theName
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 variablelb_tags
. This module currently overrides anyName
tag I pass with the value ofname_prefix
. By changing the order of themerge()
on the tags, the module can still setName
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?
examples/*
to demonstrate and validate my change(s)examples/*
projectsI deployed a load balancer using this module, version 8.1, with
lb_tags = { "Name" = "MyLoadBalancer" }
and thename_prefix = "mylb-"
. After I deployed the load balancer, theName
tag was defined asmylb-
. I switched the module source in my terraform to use my feature branch and ran terraform apply. TheName
tag was updated toMyLoadBalancer
pre-commit run -a
on my pull request