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

Tags for ALB target group resources doesn't work, updating priorities doesn't work #8847

Closed
tomgoren opened this issue Sep 15, 2016 · 10 comments · Fixed by #13200
Closed

Tags for ALB target group resources doesn't work, updating priorities doesn't work #8847

tomgoren opened this issue Sep 15, 2016 · 10 comments · Fixed by #13200

Comments

@tomgoren
Copy link
Contributor

tomgoren commented Sep 15, 2016

Greetings! I am running into a couple of issues with the new ALB resources.

Terraform Version

18:12 $ terraform -v
Terraform v0.7.3

Affected Resource(s)

  • aws_alb_target_group
  • aws_alb_listener_rule

Terraform Configuration Files

resource "aws_alb_target_group" "alb_target_group_alpha" {
  name     = "alb_target_group_alpha"
  port     = 80
  protocol = "HTTP"
  vpc_id = "${var.vpc_id}"
  tags {
    ExampleTag = "I_AM_A_VALUE"
  }
}
resource "aws_alb_listener_rule" "forward_traffic_alpha" {
  listener_arn = "${aws_alb_listener.alb_listener_alpha.arn}"
  priority = 1000

  action {
    type = "forward"
    target_group_arn = "${aws_alb_target_group.alb_target_group_alpha.arn}"
  }

  condition {
    field = "path-pattern"
    values = ["*"]
  }
}

Expected Behavior

Priority should have been updated in AWS when changing value in config file.
terraform plan indicates that tags will be updated, and that priority will be changed.

Actual Behavior

None of the above.
In order to change the priorities, the ALB had to be recreated (i.e. manually deleted and then run terraform apply).
Tags are not applied to the target group resource at all.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Create an aws_alb_target_group resource with tags
  2. Run terraform apply
  3. Expect tags
  4. Be disappointed

OR

  1. Change priorities of listener rule
  2. terraform apply
  3. Nothing changed

Apologies if missing critical information - this is my first time opening a ticket.
Thanks!

@tomgoren tomgoren changed the title Updating ALB resources doesn't work, Tags for ALB resources doesn't work Tags for ALB target group resources doesn't work, updating priorities doesn't work Sep 15, 2016
@tomgoren
Copy link
Contributor Author

Tags work as expected for aws_alb resources.

@rbuels
Copy link

rbuels commented Sep 26, 2016

I am also seeing in 0.7.4 that updating the "name" attribute of an aws_alb_target_group doesn't work. terraform tries at every apply to change the name, but the name is never actually updated in AWS.

@tomgoren
Copy link
Contributor Author

tomgoren commented Sep 26, 2016

Good catch! Thanks for the follow up - I'm glad this is getting some traction. This has been my workaround thus far:

I added an entry in outputs.tf to produce the ARN of the Target Group, and wrote a script in the meantime to apply the tags manually to that ARN.

@stack72
Copy link
Contributor

stack72 commented Oct 7, 2016

Hi @tomgoren

so i've lost track of what the issue here is - is it to do with tags or to do with priorities?

Thanks

Paul

@tomgoren
Copy link
Contributor Author

tomgoren commented Oct 18, 2016

@stack72 sorry about that!

When I originally filed this issue - both were buggy, i.e. the tags weren't being updated and nor was the priority of the listener rule in question.

I'm going to do some testing with 0.7.7 today to verify that this is still pertinent (I suspect it is as I haven't seen anything in the Changelog referencing the ALB resources).

@tomgoren
Copy link
Contributor Author

tomgoren commented Oct 19, 2016

Indeed - tags still aren't set. In the interim I wrote a script and called it with local_exec to add the tags appropriately.

Verified that priorities aren't set as expected either.

BTW the output from terraform plan shows that the command wants to make the changes, they just never take effect in terraform apply.

@tomgoren
Copy link
Contributor Author

tomgoren commented Nov 3, 2016

Still getting:

~ module.environment.shizbot.aws_alb_target_group.shizbucket
    tags.%: "" => "<computed>"

This is despite the fact that the tags are already set manually, and match the interpolated value. This just appears every single run of terraform plan no matter what.

@stack72
Copy link
Contributor

stack72 commented Mar 30, 2017

@tomgoren just a FYI, I am working on this right now

stack72 added a commit that referenced this issue Mar 30, 2017
Fixes: #8847

We actually didn't get the list of tags from the API, therefore, any
manual changes were not actually showing up in subsequent plans

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALBTargetGroup_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/30 15:45:53 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALBTargetGroup_basic -timeout 120m
=== RUN   TestAccAWSALBTargetGroup_basic
--- PASS: TestAccAWSALBTargetGroup_basic (62.76s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	62.787s
```
@tomgoren
Copy link
Contributor Author

Awesome, thanks @stack72!!!

stack72 added a commit that referenced this issue Mar 31, 2017
Fixes: #8847

We actually didn't get the list of tags from the API, therefore, any
manual changes were not actually showing up in subsequent plans

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSALBTargetGroup_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/30 15:45:53 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSALBTargetGroup_basic -timeout 120m
=== RUN   TestAccAWSALBTargetGroup_basic
--- PASS: TestAccAWSALBTargetGroup_basic (62.76s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	62.787s
```
@ghost
Copy link

ghost commented Apr 14, 2020

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants