You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey all, I'm running into an issue where the target group name is too long for AWS, which breaks the deply.
In AWS, target group names are very limited in their length (32 chars). That only allows 15 chars for "prefix" and "cluster_name" combined, or the entire tf apply will fail.
resource"aws_lb_target_group""alb_target_group" {
count=var.create_alb?1:0name="${var.prefix}-${var.cluster_name}-lb-target-group"# <<<<< THIS IS TOO LONG
A really easy solution for this would be to shorten the name that's generated to something like the following. That would allow 28 characters for the combined prefix+cluster_name.
And/or it might also be a good option to allow a user to specify an alternative target group name as a var, so they can use as long of a prefix+cluster_name that they want, but specify a shorter name for the target group that fits within AWS naming rules.
A final comprehensive solution might be to hash the full target group name value into a short hash. Then, truncate the name and append the hash so it fits within 32 chars. That would allow names of any size (at the expense of the name looking nice)
Here's what I'm trying to express, written in HCL.
Hey all, I'm running into an issue where the target group name is too long for AWS, which breaks the deply.
In AWS, target group names are very limited in their length (32 chars). That only allows 15 chars for "prefix" and "cluster_name" combined, or the entire tf apply will fail.
A really easy solution for this would be to shorten the name that's generated to something like the following. That would allow 28 characters for the combined prefix+cluster_name.
And/or it might also be a good option to allow a user to specify an alternative target group name as a var, so they can use as long of a prefix+cluster_name that they want, but specify a shorter name for the target group that fits within AWS naming rules.
A final comprehensive solution might be to hash the full target group name value into a short hash. Then, truncate the name and append the hash so it fits within 32 chars. That would allow names of any size (at the expense of the name looking nice)
Here's what I'm trying to express, written in HCL.
Here is the relevant place in the code
terraform-aws-weka/alb.tf
Line 18 in 4660301
The text was updated successfully, but these errors were encountered: