Skip to content

Commit 30240ff

Browse files
authored
provider/azurerm: Do not pass an empty string of license_type to AMR VMs (hashicorp#10564)
1 parent fde474d commit 30240ff

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

builtin/providers/azurerm/resource_arm_virtual_machine.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,14 +488,17 @@ func resourceArmVirtualMachineCreate(d *schema.ResourceData, meta interface{}) e
488488

489489
networkProfile := expandAzureRmVirtualMachineNetworkProfile(d)
490490
vmSize := d.Get("vm_size").(string)
491-
licenseType := d.Get("license_type").(string)
492491
properties := compute.VirtualMachineProperties{
493492
NetworkProfile: &networkProfile,
494493
HardwareProfile: &compute.HardwareProfile{
495494
VMSize: compute.VirtualMachineSizeTypes(vmSize),
496495
},
497496
StorageProfile: &storageProfile,
498-
LicenseType: &licenseType,
497+
}
498+
499+
if v, ok := d.GetOk(""); ok {
500+
license := v.(string)
501+
properties.LicenseType = &license
499502
}
500503

501504
if _, ok := d.GetOk("boot_diagnostics"); ok {

0 commit comments

Comments
 (0)