Skip to content

[Bug]: Fixed-response in ALB listener rule fails with multibyte characters exceeding 342 characters  #37802

@akhn1004

Description

@akhn1004

Terraform Core Version

1.7.5

AWS Provider Version

5.5.2

Affected Resource(s)

  • aws_lb_listener_rule

Expected Behavior

Can be configured with 1024 characters (even multi byte characters).

Actual Behavior

Failure in terraform plan.

Error: expected length of action.0.fixed_response.0.message_body to be in the range (0 - 1024), got ......

Relevant Error/Panic Output Snippet

│ Error: expected length of action.0.fixed_response.0.message_body to be in the range (0 - 1024), got 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
│
│   with aws_lb_listener_rule.test,
│   on share_elb_main.tf line 94, in resource "aws_lb_listener_rule" "test":
│   94:       message_body = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012"

Terraform Configuration Files

resource "aws_lb_listener_rule" "test" {
  listener_arn = aws_alb_listener.test.arn
  priority     = 100
  action {
    type = "fixed-response"

    fixed_response {
      content_type = "text/plain"
      message_body = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012"
      status_code  = 200
    }
  }

Steps to Reproduce

  1. Create an empty AWS ALB.
  2. Create an empty AWS ELB listener.
  3. Create an empty AWS ELB target group.
  4. Create a AWS ELB listerner rule with fixed_response. Set 342 characters in message body of fixed_response.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/elbv2Issues and PRs that pertain to the elbv2 service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions