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

Terraform fails to apply config on existing ALB Target Groups #9154

Closed
nicolas-g opened this issue Sep 30, 2016 · 6 comments
Closed

Terraform fails to apply config on existing ALB Target Groups #9154

nicolas-g opened this issue Sep 30, 2016 · 6 comments

Comments

@nicolas-g
Copy link

We are using a module in order to create new AWS Application Load Balancers (ALB) along with the desired security groups, listeners and target groups.

When the Target Group name is change in our config Terraform apply shows that runs successful but it hasn't actually made any changes on the target group, each time you run plan you see the target group should be renamed.

The main reason for that is because the target groups cannot be renamed and need to be re-created with the new name, I think Terraform tries to terminate the existing Target Group in order to create a new one but it can't because in order to delete a Target Group it must not be used by any LB listener.

The manually solution we follow is to manually go to the AWS console and , remove that target group from any LB listener and delete the target group my self, then Terraform apply will run successfully and running plan later will show no differences.

This is an annoying and time consuming procedure, I would expect Terraform can handle and automate all that.

Terraform Version

Terraform v0.7.3

Affected Resource(s)

  • aws_alb_target_group

Terraform Configuration Files

# Create a HTTPS target group
resource "aws_alb_target_group" "service_public_443" {
  name     = "${var.service_prefix}-${var.env}-public-443"
  port     = 443
  protocol = "HTTPS"
  vpc_id   = "${data.terraform_remote_state.network.vpc-id}"

  health_check {
    healthy_threshold   = 2
    unhealthy_threshold = 2
    timeout             = 5
    interval            = 30
    path                = "${var.health_check_path}"
    protocol            = "HTTPS"
    port                = 443
  }
}

Expected Behavior

Terrafrom should be able to have renamed or re-provision the target group.

Actual Behavior

It doesn't matter how many times I run plan and apply , apply will show success but plan will show the bellow :

~ module.service.aws_alb_target_group.service_public_443
    name: "name-prod-443" => "newname-prod-public-443"

Steps to Reproduce

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

  1. terraform apply
  2. terraform plan
  3. repeat config: bundle metadata requires global constraints #1 and config: override file loading #2 as many times..
@stack72
Copy link
Contributor

stack72 commented Oct 3, 2016

Hi @nicolas-g

Thanks for the bug report here - luckily, we have already fixed this for Terraform 0.7.5 via #8989

This should be released with the next couple of days

Thanks

Paul

@gustavosoares
Copy link

gustavosoares commented Mar 13, 2017

Has this issue been fixed? I am having the same issue now.. running terraform v0.8.8

@marccardinal
Copy link
Contributor

This is indeed still occurring in v0.8.8, I have to rename the target_group when I make changes.

@stack72
Copy link
Contributor

stack72 commented Apr 15, 2017

Hi @marccardinal / @gustavosoares

Please can you help me understand what issue you are facing?

Paul

@gustavosoares
Copy link

Sorry for the late reply @stack72 (easter holiday). I've created a target group with terraform, then I made some changes and terraform failed to apply it.

@ghost
Copy link

ghost commented Apr 13, 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 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants