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.84k stars 9.19k forks source link

[Bug]: aws_lb_target_group name_prefix validation #27556

Open nozo-moto opened 2 years ago

nozo-moto commented 2 years 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 2 years ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 3 weeks ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!