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
Real world azurerm_virtual_machine_data_disk_attachment is able to be in values that the terraform resource can not match. This forces the use of ignore_changes workarounds for these items.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform (and AzureRM Provider) Version
Terraform v0.14.7
+ provider registry.terraform.io/hashicorp/azurerm v2.58.0
+ provider registry.terraform.io/hashicorp/external v1.2.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.1.0
+ provider registry.terraform.io/meilleursagents/ansiblevault v2.2.0
Your version of Terraform is out of date! The latest version
is 0.15.4. You can update by downloading from https://www.terraform.io/downloads.html
I should be able to get a clean plan - this is an imported resource that should match the existing Azure.
Actual Behaviour
Error: expected create_option to be one of [Attach Empty], got FromImage
on common/azure_vms/vms.tf line 108, in resource "azurerm_virtual_machine_data_disk_attachment" "vm_disk_attachment":
108: resource "azurerm_virtual_machine_data_disk_attachment" "vm_disk_attachment" {
Steps to Reproduce
Have existing azure infrastructure with VM's with disk attachments that have a create_option that is one of Copy or FromImage.
@dannystaple I'm having the same issue. Trying to import an existing Azure disk that has azurerm_virtual_machine_data_disk_attachmentcreate_option set to "FromImage" and the plan is coming back requiring the disk attachment to be replaced. Just curious (because this issue is old and doesn't look like anyone has attempted to fix) were you able to get around it?
I am no longer with the client where this happened, however, the azapi terraform provider might be the answer here. https://registry.terraform.io/providers/Azure/azapi/latest/docs - decribes as an "escape hatch" for times that AzureRM provider is not fully compatible/capable with regards to the Azure API's and with a tool to verify and update such items.
Real world
azurerm_virtual_machine_data_disk_attachment
is able to be in values that the terraform resource can not match. This forces the use of ignore_changes workarounds for these items.Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_virtual_machine_data_disk_attachment
Terraform Configuration Files
Expected Behaviour
I should be able to get a clean plan - this is an imported resource that should match the existing Azure.
Actual Behaviour
Error: expected create_option to be one of [Attach Empty], got FromImage
on common/azure_vms/vms.tf line 108, in resource "azurerm_virtual_machine_data_disk_attachment" "vm_disk_attachment":
108: resource "azurerm_virtual_machine_data_disk_attachment" "vm_disk_attachment" {
Steps to Reproduce
terraform plan
Important Factoids
The code that validates in this way is at https://github.com/terraform-providers/terraform-provider-azurerm/blob/b18388439c159d5273acc03cdbe98ccd575c147b/azurerm/internal/services/compute/virtual_machine_data_disk_attachment_resource.go#L75
References
The text was updated successfully, but these errors were encountered: