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

Adding target group level tagging #115

Closed

Conversation

snoozan
Copy link

@snoozan snoozan commented Aug 28, 2019

PR o'clock

Description

Sometimes it's necessary to tag target groups at the target group level, rather than just inheriting from the parent ALB.

For example, if we have an ALB for all our QA services, the target groups underneath are tagged with what host group they are. This is useful for if you have heterogenous services running under the same LB. In our case, we have several dev instances that are tagged with their HostGroup : dev and Index: n for easy filtering on which target groups are available to stick an instance under. I've made these changes for our local fork, but since we'd like to keep upstream changes and avoid conflicts, I figured making this PR would be a good idea. Let me know if this is something you'd like to see in the module!

Example:

 "id": "arn:aws:elasticloadbalancing:us-west-2:794037559540:targetgroup/bar/2e899aec2bc4367c",
             "lambda_multi_value_headers_enabled": false,
             "name": "bar",
             "name_prefix": null,
             "port": 8080,
             "protocol": "HTTP",
             "proxy_protocol_v2": false,
             "slow_start": 100,
             "stickiness": [
               {
                 "cookie_duration": 86400,
                 "enabled": true,
                 "type": "lb_cookie"
               }
             ],
             "tags": {
               "Environment": "test",
               "GithubOrg": "terraform-aws-modules",
               "GithubRepo": "tf-aws-alb",
               "HostGroup": "Bar",
               "Name": "bar",
               "Workspace": "default"
             },
             "target_type": "instance",

Checklist

  • terraform fmt and terraform validate both work from the root and examples/alb_test_fixture directories (look in CI for an example)
  • Tests for the changes have been added and passing (for bug fixes/features)
  • Test results are pasted in this PR (in lieu of CI)
  • Docs have been added/updated (for bug fixes/features)
  • Any breaking changes are noted in the description above

Testing notes

Test: https://gist.github.com/snoozan/9d6c494cdfdab8f8427fdb031bf957a8
The RSpec framework being used doesn't spec out tags at the target group level. This could be added to the library, but as of right now, no spec tests were written because of the lack of target group tags. See: k1LoW/awspec@a3e729e#diff-1acc82be899fcf02f9d1974a4850e3f8

@snoozan
Copy link
Author

snoozan commented Aug 28, 2019

Not sure if I am supposed to set the AWS credentials in the PR: https://travis-ci.org/terraform-aws-modules/terraform-aws-alb/jobs/577922309

@snoozan
Copy link
Author

snoozan commented Sep 9, 2019

@antonbabenko Have you had a chance to take a look at this?

@bryantbiggs
Copy link
Member

this functionality has been covered under #151

@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 15, 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