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

aws_lb_listener.http_redirect Invalid Attribute Combination #154

Open
mission-ajennings opened this issue Feb 2, 2024 · 1 comment
Open
Labels
bug 🐛 An issue with the system

Comments

@mission-ajennings
Copy link

mission-ajennings commented Feb 2, 2024

Describe the Bug

In AWS provider 5.35.0 released 2/1/24 if you have a target group arn on a listener with type 'redirect' it will give this warning:

│ Warning: Invalid Attribute Combination
│
│   with module.alb.aws_lb_listener.http_redirect[0],
│   on .terraform/modules/alb/main.tf line 183, in resource "aws_lb_listener" "http_redirect":
│  183:     target_group_arn = one(aws_lb_target_group.default[*].arn)
│
│ Attribute "default_action[0].target_group_arn" cannot be specified when "default_action[0].type" is "redirect".
│
│ This will be an error in a future release.

Expected Behavior

No warnings (or future errors) when deploying a redirect listener.

Steps to Reproduce

Upgrade to AWS provider 5.35.0 and attempt to deploy an ALB with a redirect listener.

Screenshots

No response

Environment

No response

Additional Context

No response

@veqryn
Copy link

veqryn commented Oct 22, 2024

I received this warning even though I didn't specify the target arn at all:

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

  default_action {
    type = "redirect"

    redirect {
      status_code = "HTTP_301"
      protocol    = "HTTPS"
      port        = "443"
    }
  }
}
╷
│ Warning: Invalid Attribute Combination
│
│   with aws_lb_listener.mylb,
│   on loadbalancer.tf line 96, in resource "aws_lb_listener" "mylb":
│   96:   default_action {
│
│ Attribute "default_action[0].target_group_arn" cannot be specified when "default_action[0].type" is "redirect".
│
│ This will be an error in a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
2 participants