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]: aws_lb_listener_rule forward action missing in state #35576

Closed
liad5h opened this issue Jan 31, 2024 · 3 comments · Fixed by #35671
Closed

[Bug]: aws_lb_listener_rule forward action missing in state #35576

liad5h opened this issue Jan 31, 2024 · 3 comments · Fixed by #35671
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

@liad5h
Copy link

liad5h commented Jan 31, 2024

Terraform Core Version

1.6.6

AWS Provider Version

5.34.0

Affected Resource(s)

aws_lb_listener_rule

Expected Behavior

I believe that the forward array in the state below should not be empty.
This results in terraform asking to update the action.forward blocks on every plan and apply

Actual Behavior

{
      "module": "RESOURCE_NAME",
      "mode": "managed",
      "type": "aws_lb_listener_rule",
      "name": "test",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "action": [
              {
                "authenticate_cognito": [],
                "authenticate_oidc": [],
                "fixed_response": [],
                "forward": [],
                "order": 1,
                "redirect": [],
                "target_group_arn": "CORRECT_ARN",
                "type": "forward"
              }
            ]
          }
        }
      ]
    }

Relevant Error/Panic Output Snippet

no errors

Terraform Configuration Files

variable "actions" {
  type = object({
    forward = optional(object({
      target_group_arn = optional(string)
      target_group = list(object({
        arn = string
        weight = optional(number)
      }))
    }))
  })
}

resource "aws_lb_listener_rule" "this" {
  listener_arn = var.listener_arn
  priority = var.priority

  dynamic "action" {
    for_each = var.actions.forward != null ? toset(["forward"]) : toset([])
    content {
      type = "forward"
      target_group_arn = var.actions.forward.target_group_arn
      dynamic "forward" {
        for_each = toset(["forward"])
        content {
          dynamic "target_group" {
            for_each = var.actions.forward.target_group
            content {
              arn = target_group.value.arn
              weight = target_group.value.weight
            }
          }
        }
      }
    }
  }
# rest of the resource is not relevant

Steps to Reproduce

Create a listener rule for the ALB with the following tfvars

terraform.tfvars:

actions = {
  forward = {
    target_group_arn = "TARGET_GROUP_ARN"
    target_group = [
      arn = "TARGET_GROUP_ARN"
    ]
  }
}

run terraform apply twice, on the second run it will want to add the forwrad block again.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@liad5h liad5h added the bug Addresses a defect in current functionality. label Jan 31, 2024
@github-actions github-actions bot added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label Jan 31, 2024
Copy link

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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 31, 2024
@gdavison gdavison self-assigned this Feb 2, 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 2, 2024
@github-actions github-actions bot added this to the v5.36.0 milestone Feb 7, 2024
@terraform-aws-provider terraform-aws-provider bot removed the needs-triage Waiting for first response or review from a maintainer. label 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
3 participants