hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 9k forks source link

[Bug]: aws_lb_target_group name_prefix validation #27556

Open nozo-moto opened 1 year ago

nozo-moto commented 1 year ago

Terraform Core Version

1.3.3

AWS Provider Version

4.37.0

Affected Resource(s)

Expected Behavior

This validation should Ignore variables or consider expansion.

Actual Behavior

This validation is return invalid even if name_prefix has variable. And If value length exceeded 6, it return invalid.

validation code. https://github.com/hashicorp/terraform-provider-aws/blob/a72a7ff01e42010a75e0f8088aa53b96645d4ca9/internal/service/elbv2/validate.go#L82-L98

https://github.com/hashicorp/terraform-provider-aws/blob/e3c56e8aed8cfe637c9870e547984bcf023aaaa8/internal/service/elbv2/target_group.go#L149-L155

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {}
resource "aws_alb_target_group" "tg" {
  count       = 5
  name_prefix = "tg-${count.index + 1}"
  port        = "80"
  protocol    = "HTTP"
  vpc_id   = aws_vpc.main.id
}

Steps to Reproduce

terraform validate

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue