Skip to content
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

Unable to create azurerm_managed_disk using azurerm_disk_encryption_set of type EncryptionAtRestWithPlatformAndCustomerKeys #10588

Closed
dandcg opened this issue Feb 15, 2021 · 2 comments · Fixed by #14218

Comments

@dandcg
Copy link

dandcg commented Feb 15, 2021

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.6
+ provider registry.terraform.io/cloudposse/utils v0.3.0
+ provider registry.terraform.io/hashicorp/azurerm v2.46.1
+ provider registry.terraform.io/hashicorp/null v3.0.0
+ provider registry.terraform.io/hashicorp/random v3.0.1
+ provider registry.terraform.io/hashicorp/template v2.2.0

Affected Resource(s)

  • azurerm_managed_disk

Terraform Configuration Files

resource "azurerm_managed_disk" "data_disks" {
  for_each               = var.data_disks
  name                   = "disk-${local.vm_name}-data${each.value.lun + 1}"
  location               = var.location
  resource_group_name    = var.rg.name
  storage_account_type   = each.value.storage_account_type
  create_option          = "Empty"
  disk_size_gb           = each.value.disk_size_gb
  disk_encryption_set_id = var.des.id
  tags                   = merge(local.tags, { disk-type = "data", disk-name = each.key })
  lifecycle {
    ignore_changes = [
      name,              
      create_option,       
      source_resource_id, 
      tags,               
    ]
  }
}

Output

Error: Error updating Managed Disk "disk-xxx-data1" (Resource Group "rg-xxx"): compute.DisksClient#Update: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="The type of the Disk Encryption Set in the request is EncryptionAtRestWithCustomerKey, but this Disk Encryption Set was created with type EncryptionAtRestWithPlatformAndCustomerKeys."

Expected Behaviour

Managed disk should be created with disk encryption set of type EncryptionAtRestWithPlatformAndCustomerKeys. Incidentally this type of disk encryption set works with the os disk when creating a VM.

Actual Behaviour

Managed disk not created - error shown above.

Steps to Reproduce

terraform apply

References

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-enable-double-encryption-at-rest-cli

@github-actions
Copy link

This functionality has been released in v2.86.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants