Closed Folling closed 3 weeks ago
Hi @Folling, thanks for reporting and providing the regexp.
The code was committed 3 years ago, might be out of date. I opened a PR(https://github.com/hashicorp/terraform-provider-azurerm/pull/26701) to update the validation.
For any further discussion please leave comments
Is there an existing issue for this?
Community Note
https://github.com/hashicorp/terraform-provider-azurerm/blob/1aef7c1bc3e8afa3a15a1091ae2dd4c823e816ed/internal/services/loganalytics/log_analytics_saved_search_resource.go#L95
This regex is wrong and excludes tabular parameters in the form of
arg:(*)
orarg:(sub_arg:type,sub_arg:type2)
.For more info, see here: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/functions/user-defined-functions.
I also think the regex currently in use has some issues, such as the first segment being
*
instead of+
or that!
is allowed within argument names. There's more, but let's keep it brief. Here's a regex I think is (more) correct:I'm aware it's a bit of a mess, but it matches things pretty convincingly (note that tabular arguments do not support default values): https://regex101.com/r/n99EPo/1
Terraform Version
v1.9.0
AzureRM Provider Version
3.112.0
Affected Resource(s)/Data Source(s)
azurerm_log_analytics_saved_search
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Terraform should respect all valid function parameter definitions.
Actual Behaviour
It doesn't.
Steps to Reproduce
No response
Important Factoids
No response
References
https://github.com/hashicorp/terraform-provider-azurerm/pull/11341 https://github.com/hashicorp/terraform-provider-azurerm/issues/10989