-
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
Add name_prefix
to aws_alb_target_group
#13442
Add name_prefix
to aws_alb_target_group
#13442
Conversation
Adds the `name_prefix` parameter to the `aws_alb_target_group` resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question/request for docs, other than that 👍
@@ -31,7 +31,8 @@ resource "aws_vpc" "main" { | |||
|
|||
The following arguments are supported: | |||
|
|||
* `name` - (Required) The name of the target group. | |||
* `name` - (Optional, Forces new resource) The name of the target group. If omitted, Terraform will assign a random, unique name. | |||
* `name_prefix` - (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with `name`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please include the character limits here in the documentation? Also, why the 6
character limit for the prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 6 character limit is because name_prefix
generates 26 characters of randomness and the maximum length for the name imposed by AWS is 32 characters. See #12947.
LGTM thanks :)
|
|
||
func validateAwsAlbTargetGroupNamePrefix(v interface{}, k string) (ws []string, errors []error) { | ||
name := v.(string) | ||
if len(name) > 32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 6
, not 32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ashb - what makes you think it should be 6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That the message on the next line says 6! (I came here because I got this error upon trying name_prefix:
- aws_alb_target_group.mod: Error creating ALB Target Group: ValidationError: Target group name 'ash-test-airflow-webserver0019dc824d8cf5fe93abbb8785' cannot be longer than '32' characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the discussion 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. |
Adds the
name_prefix
parameter to theaws_alb_target_group
resource.