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
I'm not a Go developer, but I've tried to fix function below:
func ProtocolWithPort(input interface{}, k string) (warnings []string, errors []error) {
v, ok := input.(string)
if !ok {
errors = append(errors, fmt.Errorf("expected %s to be a string", k))
return
}
parts := strings.Split(v, ":")
if len(parts) != 2 {
if v != "any" && v != "application-default" {
errors = append(errors, fmt.Errorf("expected %s to be 'any' or 'application-default' or a two part string separated by a `:`, e.g. TCP:80", k))
return
}
} else {
if parts[0] != "TCP" && parts[0] != "UDP" {
errors = append(errors, fmt.Errorf("protocol portion of %s must be one of `TCP` or `UDP`, got %q", k, parts[0]))
}
port, err := strconv.Atoi(parts[1])
if err != nil || port == 0 || port > 65535 {
errors = append(errors, fmt.Errorf("port in %s must me an integer value between 1 and 65535, got %q", k, parts[1]))
}
}
return
}
Terraform Version
1.8.2
AzureRM Provider Version
3.102
Affected Resource(s)/Data Source(s)
azurerm_palo_alto_local_rulestack_rule
Terraform Configuration Files
Not sure what you need here
Debug Output/Panic Output
Not sure what you need here
Expected Behaviour
No response
Actual Behaviour
No response
Steps to Reproduce
No response
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Community Note
When using azurerm_palo_alto_local_rulestack_rule Terraform module, you cannot specify "any" as a value for protocol field. It's supported value when you make changes via REST API, but not when you try to do that via Terraform. It appears that the issue is related to validation function: https://github.com/hashicorp/terraform-provider-azurerm/blob/main/internal/services/paloalto/validate/protocol.go .
I'm not a Go developer, but I've tried to fix function below:
Terraform Version
1.8.2
AzureRM Provider Version
3.102
Affected Resource(s)/Data Source(s)
azurerm_palo_alto_local_rulestack_rule
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
No response
Actual Behaviour
No response
Steps to Reproduce
No response
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: