-
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_site_recovery_replicated_vm - On Import with Managed Disks Encrypted with PMK are "target_disk_encryption" and "target_disk_encryption_set_id" required? #23159
Comments
Hi @JD-Phx , thanks for opening this issue. Could you please update your Terraform and azurerm provider, then give it another try with the environment variable Thanks. |
I've updated the Terraform Version, and Provider version to the latest, and there is no change on the output. This is running in a live environment, so I will have to sanitise the debug file before uploading it. There's also a lot of resources within the environment, so I'll try and reduce the unnecessary resources. I may have to setup a dev environment with just the minimum resources to redeploy this resource and replicate the issue. |
Hey @JD-Phx I tried to reproduce the error, but I cant. Could you please some more details about how it happened?
And, just to confirm: the log shows it was errored on |
Hi @ziyeqf I appreciate you trying to replicate the issue for me. I'll see if I can't put something together today to replicate it, as the clients main subscription is throwing a lot of these errors. That's pretty close:
It wouldn't be so bad if the plan ran, and just told me what config it's going to change, and by the documentation, those are not required properties, so I should be able to run the plan without them. I could then extract the values and add them in. It seems like the provider has these flagged as required, and I'm not sure they should be. If this resource were deploy with MS Platform Managed Keys, you wouldn't know these values, and there's nothing within the resource block to specify its CMK or PMK. I've also tried adding the disks in via a data block, and calling the values that way as they are unknown to me, and cannot be accessed via the portal. Unfortunately, when the plan runs, it suggests that the values are blank/empty/null, which I suspect is a permissions issue, as the resource is actually MS managed. Yes, apologies, that's my poor manual editing skills. The config is taken from the documentation page, but matches what is being imported, and the output is from the live environment, and I didnt match the name up properly. I've rectified that for future viewers. |
Hey @JD-Phx
to
Then it should work. For any further questions please leave comments. |
Hi @ziyeqf I tried updating the code with the [ ] removed, but I now get a different error:
There appears to be a underscore squiggle (like you get with a spelling mistake) before the opening { in my vs code terminal, that hasn't copied across. IGNORE THIS: I didn't remove the = sign! |
Thank you @ziyeqf!! That's amazing work, I'd have never worked that out! It's odd how terraform returned an error that makes sense, but it was actually the format of the managed disk block that was incorrect! I'll definitely keep an eye out for that one. |
Is there an existing issue for this?
Community Note
Terraform Version
1.5.5
AzureRM Provider Version
3.65
Affected Resource(s)/Data Source(s)
azurerm_site_recovery_replicated_vm
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The provider documentation shows that these elements should be optional: https://registry.terraform.io/providers/hashicorp/azurerm/3.65.0/docs/resources/site_recovery_replicated_vm#target_disk_encryption_set_id
So on a plan run, this should not error.
Actual Behaviour
This is an import that I'm attempting, I'm unsure if this due to the disks being encrypted with platform managed keys (that the details cannot be accessed for) is causing these to be flagged as required, but this is a plan, so these shouldn't be required, but rather show as a change on at the end.
Steps to Reproduce
No response
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: