-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_policy_definition mode is case sensitive #8748
Comments
hi @sebastus Thanks for opening this issue. Taking a look into this this appears to be a bug where the validation for the Thanks! |
Policy creation succeeds even if the policy mode in the request is not capitalized, however, when fetching the policy mode value from Azure, the correct capitalized version is returned, which causes the Terraform state and configuration to be different. Ideally, there should be an enum with a set of allowed values, but thi is not the case in the latest version of the Azure Rest API specs. However, the supported mode values are returned in the create error response when an invalid mode is requested. Fixes hashicorp#8748
Policy creation succeeds even if the policy mode in the request is not capitalized, however, when fetching the policy mode value from Azure, the correct capitalized version is returned, which causes the Terraform state and configuration to be different. Ideally, there should be an enum with a set of allowed values, but this is not the case in the latest version of the Azure Rest API specs. However, the supported mode values are returned in the error response when an invalid mode is requested. Fixes hashicorp#8748
Policy creation succeeds even if the policy mode in the request is not capitalized, however, when fetching the policy mode value from Azure, the correct capitalized version is returned, which causes the Terraform state and configuration to be different. Ideally, there should be an enum with a set of allowed values, but this is not the case in the latest version of the Azure Rest API specs. However, the supported mode values are returned in the error response when an invalid mode is requested. Fixes hashicorp#8748
Policy creation succeeds even if the policy mode in the request is not capitalized, however, when fetching the policy mode value from Azure, the correct capitalized version is returned, which causes the Terraform state and configuration to be different. Ideally, there should be an enum with a set of allowed values, but this is not the case in the latest version of the Azure Rest API specs. However, the supported mode values are returned in the error response when an invalid mode is requested. Fixes #8748
This has been released in version 2.31.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.31.0"
}
# ... other configuration ... |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_policy_definition
Terraform Configuration Files
Expected Behavior
When this snippet is applied, a policy definition is created as one would expect. A "terraform plan" after apply should yield that no changes are required.
Actual Behavior
However, a "terraform plan" after "terraform apply" yields the need to update the resource.
The problem is a case sensitive comparison on the 'mode' property and that mode "indexed" is stored as "Indexed" during apply.
Steps to Reproduce
terraform apply
with the snippetterraform plan
Important Factoids
References
The text was updated successfully, but these errors were encountered: