Failed to decode planned changes for aws_lb_listener

Hey folks, I’m trying to create a load balanced EC2 and part of that using aws_lb_listener, the plan gets created fine and is something around the lines of:

  # aws_lb_listener.app will be created
  + resource "aws_lb_listener" "app" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + load_balancer_arn = "arn:aws:elasticloadbalancing:xxx:xxx:loadbalancer/app/xxx-lb/xxx"
      + port              = 80
      + protocol          = "HTTP"
      + ssl_policy        = (known after apply)

      + default_action {
          + order            = (known after apply)
          + target_group_arn = "arn:aws:elasticloadbalancing:xxx:xxx:targetgroup/tf-xxx-lb/xxx"
          + type             = "forward"
        }
    }

But when applying I get the error message:
Error: failed to decode planned changes for aws_lb_listener.app: error decoding ‘after’ value: an object with 10 attributes is required (9 given)

Please help.

That’s a weird error message indeed.

Did you already try to enable trace logging with TF_LOG environment variables? That is often a good start for finding the cause of the issue (Debugging - Terraform by HashiCorp).