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

[Bug]: unexpected plan diff on aws_lb_listener when upgrading from 5.34.0 to 5.35.0 #35668

Closed
jrobison-sb opened this issue Feb 6, 2024 · 4 comments · Fixed by #35678
Closed
Assignees
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@jrobison-sb
Copy link
Contributor

Terraform Core Version

v1.6.6

AWS Provider Version

5.35.0

Affected Resource(s)

  • aws_lb_listener

Expected Behavior

I should be able to upgrade from provider 5.34.0 to provider 5.35.0 without any unexpected plan diffs on my existing resources.

Actual Behavior

I get unexpected plan diffs on aws_lb_listener resources when upgrading from provider 5.34.0 to provider 5.35.0.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_lb_listener" "http" {
  load_balancer_arn = aws_lb.foo.arn
  port              = "80"
  protocol          = "HTTP"

  default_action {
    target_group_arn = aws_lb_target_group.foo.arn

    type = "redirect"

    redirect {
      port        = "443"
      protocol    = "HTTPS"
      status_code = "HTTP_301"
    }
  }

  tags = {
    Name       = "http"
  }
}

Steps to Reproduce

  1. Use provider 5.34.0 and create the aws_lb_listener resource seen in the provided HCL.
  2. Run a terraform plan after creating the aws_lb_listener and see that there are no diffs in the plan.
  3. Upgrade to provider 5.35.0
  4. Run another terraform plan and see diffs like this:
  # module.production_application.aws_lb_listener.http will be updated in-place
~ resource "aws_lb_listener" "http" {
        id                = "arn:aws:elasticloadbalancing:us-east-1:1234567890:listener/app/production-containers/516ae9a008e4e100/6cabefb4163ad035"
        tags              = {
            "Name"       = "http"
        }
        # (5 unchanged attributes hidden)

      ~ default_action {
          + target_group_arn = "arn:aws:elasticloadbalancing:us-east-1:1234567890:targetgroup/tf-20181027131523749800000002/52249f311b1188f3"
            # (2 unchanged attributes hidden)

            # (1 unchanged block hidden)
        }

      - timeouts {}
    }

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

#35583

Would you like to implement a fix?

No

@jrobison-sb jrobison-sb added the bug Addresses a defect in current functionality. label Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label Feb 6, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 6, 2024
@gdavison gdavison self-assigned this Feb 6, 2024
@gdavison gdavison removed the needs-triage Waiting for first response or review from a maintainer. label Feb 6, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Feb 6, 2024
@jrobison-sb
Copy link
Contributor Author

@gdavison thanks for looking at this. Since your PR mentioned "invalid attributes", I went back and checked if my attributes seen in the HCL above were actually valid, which they aren't.

resource "aws_lb_listener" "http" {
  load_balancer_arn = aws_lb.foo.arn
  port              = "80"
  protocol          = "HTTP"

  default_action {
    target_group_arn = aws_lb_target_group.foo.arn # NOT VALID BECAUSE I"M DOING A REDIRECT

    type = "redirect"

    redirect {
      port        = "443"
      protocol    = "HTTPS"
      status_code = "HTTP_301"
    }
  }

  tags = {
    Name       = "http"
  }
}

I was able to fix my HCL and remove the invalid attributes. So I personally no longer need the PR linked here, though I also have no objection to that PR if you still think it adds value.

I'll let you decide if this ticket should stay open or not. Feel free to close it if you like.

Thanks again for your attention to this and for helping me clean up my code a bit.

@github-actions github-actions bot added this to the v5.36.0 milestone Feb 7, 2024
@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Feb 8, 2024
Copy link

github-actions bot commented Feb 8, 2024

This functionality has been released in v5.36.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants