terraform-azurerm-caf
terraform-azurerm-caf copied to clipboard
unable to add Disk encryption key set for VM OS and data disk
Is there an existing issue for this?
- [X] I have searched the existing issues
Community Note
- Please vote on this issue by adding a :thumbsup: 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
Version of the module you are using
5.6.0
Rover Version
1.2.1-2206.0903
Terraform Version
No response
AzureRM Provider Version
No response
Affected Resource(s)/Data Source(s)
azurerm_disk_encryption
Terraform Configuration Files
virtual_machines = {
# deployment of Windows server for ctrlm project. This is using default credentials stored in KV
ctrlm_vm = {
resource_group_key = "ctrlM"
provision_vm_agent = true
os_type = "windows"
lz_key = "caf_auditsub"
keyvault_key = "ss_kv"
networking_interfaces = {
nic1 = {
# Value of the keys from networking.tfvars
lz_key = "caf_shared_prd"
vnet_key = "vnet1"
subnet_key = "tier4_subnet"
name = "**1-nic"
enable_ip_forwarding = false
internal_dns_name_label = "nic1"
private_ip_address_allocation = "Static"
private_ip_address = "10.189.227.7"
}
}
virtual_machine_settings = {
windows = {
name = "**"
size = "Standard_D4s_v3"
zone = "1"
delete_os_disk_on_termination = true
delete_data_disk_on_termination = true
admin_username_key = "windows-admin-username"
admin_password_key = "windows-admin-password"
license_type = "None"
timezone = "Singapore Standard Time"
network_interface_keys = ["nic1"]
os_disk = {
name = "**-os"
caching = "ReadWrite"
storage_account_type = "Standard_LRS"
lz_key = "caf_auditsub"
disk_encryption_set_key = "set_ss"
}
custom_image_id = "**/1.0.0"
}
}
data_disks = {
data_disk1 = {
name = "**datadisk1"
storage_account_type = "Standard_LRS"
create_option = "Empty"
disk_size_gb = "300"
lun = 1
zones = ["1"]
lz_key = "caf_auditsub"
disk_encryption_set_key = "set_ss"
#disk_encryption_set_id = "**/diskEncryptionSets/disksskey_prd"
}
}
}
}
Expected Behaviour
OS, Data Disk needs to be encrypted with Custom KEY but its failing with below error, we have tried resource_group, resource_grou_key keys but all are unable to lookup keyvault resource group. But I can see that resource in the remote State file, all it fails because it can't lookup. We are using specialized image but for data disk this shouldn't be an issue as disk is new.
APIM is just a warning, real failure is This object does not have an attribute named "resource_group".14-Jul-2022 15:40:48- Unsupported attribute (at ../aztfmod/automations.tf:9,292-311)14-Jul-2022 15:40:4814-Jul-2022 15:40:48 This object does not have an attribute named "resource_group_key".14-Jul-2022 15:40:4814-Jul-2022 15:40:48At least one expression must produce a successful result.14-Jul-2022 15:40:48 with
Actual Behaviour
No response
Steps to Reproduce
No response
Important Factoids
No response
References
No response