-
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
Running terraform plan against a resource group with a ReadOnly lock on it fails #3170
Comments
hey @devblackops Thanks for opening this issue :) Taking a quick look into this:
I have a feeling this "write operation" is when we request the keys for the Storage Account from the ListKeys endpoint - out of interest does the Audit Log (Resource Groups -> [name] -> Audit Log) show anything when you see this error? Thanks! |
Thanks the the quick response @tombuildsstuff! Yes, the audit log shows a failed entry for listing the storage account keys.
Also, this behavior is not present when the resource group is empty. My repro is using a storage account as a simple example but our actual config has many more resources. I'll try and repro using a similarly simple resource. |
I tested with a public IP address instead of the storage account and The behavior may be limited to resources that perform list keys or similar operations that are read only in nature but for some reason Azure prevents with a read-only resource lock. |
Upstream API issue: Azure/azure-rest-api-specs#6363 |
👋 Taking a look into this, since this is an Azure API design I don't think there's something necessarily actionable within Terraform in this issue (since it requires the API changed in Azure). Instead I'm going to close this issue in favour of #4138, which has a proposed solution (gracefully degrading Thanks! |
This has been released in version 1.34.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 = "~> 1.34.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
Terraform v0.11.11
Affected Resource(s)
azurerm_resource_group
azurerm_management_lock
Terraform Configuration Files
Debug Output
https://gist.github.com/devblackops/f8523fda1631b6b64de50ed89293d218
Panic Output
Expected Behavior
terraform plan
should say no resources need to change instead of producing an error that is can't perform awrite
operation.Actual Behavior
The resource group, storage account, and lock are created successfuly but a subsequent
terraform plan
with zero changes to the Terraform config produce an error.terraform plan
produces an error that is can't perform awrite
operation because of theReadOnly
resource group lock (what type of write operation is it trying to perform?Error
Steps to Reproduce
terraform apply
terraform plan
Important Factoids
References
The text was updated successfully, but these errors were encountered: