Skip to content

Support for EncryptionAtHost Feature Registration #17185

@paul-hugill

Description

@paul-hugill

Is there an existing issue for this?

  • I have searched the existing issues

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

Description

To use the encryption_at_host_enabled on virtual machine resources you need to enable the EncryptionAtHost feature in the Microsoft.Compute Provider Namespace.

compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="The property 'securityProfile.encryptionAtHost' is not valid because the 'Microsoft.Compute/EncryptionAtHost' feature is not enabled for this subscription." Target="securityProfile.encryptionAtHost"

The automatic provider registration does not appear to register this feature, though it looks like the support on the resources has been there for a while. I have tested with both provider version 3.6.0 and 3.9.0 but also not found any references to people using it and setting that feature up, so I am not sure if I am just doing something wrong.

Only current workaround I could find (other than doing manually) would be to turn off the automatic provider registration and having to register every provider individually, which is not going to be ideal.
Without doing that I get this error, which is expected behaviour whilst automatic registration is enabled:

Error: The Resource Provider "Microsoft.Compute" is automatically registered by Terraform. To manage this Resource Provider Registration with Terraform you need to opt-out of Automatic Resource Provider Registration (by setting 'skip_provider_registration' to 'true' in the Provider block) to avoid conflicting with Terraform.

If this doesn't want to be added as a default on the automatic registration, then maybe as a provider feature flag?
Apologies if I have just missed something obvious.

New or Affected Resource(s)/Data Source(s)

provider

Potential Terraform Configuration

provider "azurerm" {
  features {
    virtual_machine {
      encryption_at_host_enabled = true
    }
}

References

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-enable-host-based-encryption-cli#prerequisites

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionupstream/microsoftIndicates that there's an upstream issue blocking this issue/PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions