-
Notifications
You must be signed in to change notification settings - Fork 118
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
Documentation for special flag unclear #323
Comments
Hi @mcarter106 👋 Thank you for raising this, very understandable that this behavior is likely confusing right now. The resource's preference should likely be to respect the As a followup to fixing that particular behavior, it may make sense for the resource to raise a validation warning if resource "random_pet" "example" {
# ...
special = var.make_special ? true : false
min_special = var.make_special ? 2 : null
} |
This was the work around we used in our code. I just wanted to surface the issue so that maybe the documentation could make this a little more clear for the next developer. Thank you
From: Brian Flad ***@***.***>
Sent: Monday, September 19, 2022 8:56 AM
To: hashicorp/terraform-provider-random ***@***.***>
Cc: Michelle Carter ***@***.***>; Mention ***@***.***>
Subject: Re: [hashicorp/terraform-provider-random] Documentation for special flag unclear (Issue #323)
Hi @mcarter106<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmcarter106&data=05%7C01%7Cmiccarter%40microsoft.com%7Cf3e87aae59ed43fe452508da9a46a5cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637991925475981495%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=fRa4r2RY4nFuViTfTYLS%2BGOAS%2Fe5Hu1LwWmxdXgAG60%3D&reserved=0> 👋 Thank you for raising this, very understandable that this behavior is likely confusing right now. The resource's preference should likely be to respect the special = false configuration over anything specified by min_special.
As a followup to fixing that particular behavior, it may make sense for the resource to raise a validation warning if min_special is declared at the same time as special = false, to ensure maintainers of the resource configuration understand what is valid, however that would potentially make modular configurations a little harder to not show the potential validation warning:
resource "random_pet" "example" {
# ...
special = var.make_special ? true : false
min_special = var.make_special ? 2 : null
}
—
Reply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform-provider-random%2Fissues%2F323%23issuecomment-1251055066&data=05%7C01%7Cmiccarter%40microsoft.com%7Cf3e87aae59ed43fe452508da9a46a5cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637991925476137615%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=UTP4mYy7EdeK%2Ba77kvi0H2IEqymZs4isvfZJ0UnQlkk%3D&reserved=0>, or unsubscribe<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALK55MPKEJCXTYGLJV27EQ3V7BWGBANCNFSM6AAAAAAQOS46BA&data=05%7C01%7Cmiccarter%40microsoft.com%7Cf3e87aae59ed43fe452508da9a46a5cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637991925476137615%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Gz2v4Tcb8bWG4zYj9BK7Xo0NsrUtnKNWLVINUGkLGw8%3D&reserved=0>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Terraform CLI and Provider Versions
3.4.3
Terraform Configuration
Expected Behavior
The special attribute should override or throw an error when set to false and the min_special attribute is set to a non null value.
or
The documentation should be clear that the special attribute is overridden by the min_special attribute.
Actual Behavior
This results in a password with 2 special characters even though special is set to false.
Steps to Reproduce
terraform apply
How much impact is this issue causing?
Low
Logs
No response
Additional Information
I was able to write around this issue by using checks within the module but felt this was worth reporting as it is confusing.
Code of Conduct
The text was updated successfully, but these errors were encountered: