-
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
Applying azurerm_monitor_diagnostic_setting to Keyvault #8225
Comments
@DAL3001 Thank you for submitting this 👍 From the execution plan above, it seems that the If the issue still remains, can you run terraform plan with Besides, to which location are you provisioning your resources? |
Hi @magodo Sorry for the delay! In the end I couldn't replicate my issue on a fresh apply using a different Azure Subscription with the same Terraform code, so figured it must be some sort of state mixup. I tried a refresh but still had the same issue. In the end, I removed the diagnostic setting manually in the portal and ran another apply. Everything was recreated correctly and now subsequent plan/apply runs don't see to be marking the diagnostic setting for changes anymore, which is good. Not sure what the exact cause was in this case but I guess this can be closed as it doesn't appear to be an actual issue. Thanks :) |
Actually, sorry, this appears to be happening again. It wasn't happening on Friday on the first apply after the diagnostic logging resource was created, but now it is... @magodo - do you need a specific part of the DEBUG log? It seems quite revealing so would like to sanitise it a bit if you only need some specific parts? Thanks |
@DAL3001 Yes, please provide the log with As a workaround, can you try to explicitly define the |
@magodo I just tested with your suggestion. Adding: metric {
category = "AllMetrics"
enabled = false
retention_policy {
enabled = false
days = 0
}
} works are a workaround. |
Hey @etaham and @DAL3001 do you mind I close this issue as it is resolved by explicitly setting Though it might be tempting to set 0 as the default value for |
We would need to add the entire metrics block marked as disabled just to work around - it's not just setting a 0. Accidentally turning on the metrics block will result in Azure charges. Ideally, this should be fixed so people don't need to add extra code just to squelch TerraForm. |
@magodo makes sense. |
@magodo Sure |
Closing as mentioned above. |
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.12.28
provider.azurerm v2.24.0
Affected Resource(s)
azurerm_monitor_diagnostic_setting
Terraform Configuration Files
Defined in my Keyvault module against my Keyvault resource:
Debug Output
As the setting is currently configured in the state file:
Expected Behavior
No changes should be identified when running a
terraform plan
Actual Behavior
Changes are detected in the plan:
Steps to Reproduce
terraform plan
Important Factoids
I don't have this issue with my Diagnostic settings for other resources, which I'm having no issues with. I am defining all categories in all of my diagnostic_setting resource blocks, regardless of whether I want to enable them.
References
I initially thought it was the same behaviour as the issue below but after explicitly defining the
metric
block and setting it asenabled = false
my issue persistedThe text was updated successfully, but these errors were encountered: