-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Randomness added to resource names when using name_prefix can cause names to be too long #12947
Comments
Hey @joshuaspence are you still keen on working on that? I'm happy with that proposal as it leaves the responsibility of the increase in collisions to the person who defines the resource. @stack72 what do you think? |
I haven't implemented anything yet because I wasn't sure how the upstream felt about my proposal. |
@joshuaspence I would welcome such improvement. I am not sure if the change should come into That's the only bit I supose that maintainers should guide your way; who was the responsibility for truncating the extra bits. |
Hi @joshuaspence! Sorry for the silence here. This is a tough one because it seems to sit squarely on the tension in Terraform about being explicit about what is going to happen vs. including helpful behaviors to smooth over oddness in underlying APIs. One way we could address this tension is to specify am explicit maximum length for |
I just fell over this as well. Firstly: It's still not documented in https://www.terraform.io/docs/providers/aws/r/alb_target_group.html#name_prefix that the Secondly: 6 characters is not enough. I'm using prefixes and suffixes and stuff for my resource names, e.g. --> The character length of the appended random string should be reduced by For Reference: https://github.com/hashicorp/terraform/pull/13442/files#r110410247 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I've been working on adding
name_prefix
to a bunch of AWS resources lately so that multiple environments can reside in the same stack. One problem that I've come across lately is that some AWS resources have quite a small limit on the length of thename
property. I raised this issue in #12629 and was advised to create a new issue (CC @stack72). For example, the maximum length for an autoscaling group name is 32 characters. This means that the maximum length of thename_prefix
is a measly 6 characters.One way that we could work around this would be to use truncate the
name
so that it doesn't exceed the maximum length. So if the maximum length is 32 characters and I provide aname_prefix
which is 16 characters, I would only get 16 characters of randomness.I'm happy to work on implementing a solution if we can agree on one.
The text was updated successfully, but these errors were encountered: