Skip to content

Commit

Permalink
Merge pull request #212 from terraform-providers/hub-licence-type
Browse files Browse the repository at this point in the history
Support for the Windows_Client Hybrid Use Benefit
  • Loading branch information
tombuildsstuff authored Aug 7, 2017
2 parents 99cf687 + 6d4efa1 commit 42baeee
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions azurerm/resource_arm_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ func resourceArmVirtualMachine() *schema.Resource {
},

"license_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: validateLicenseType,
Type: schema.TypeString,
Optional: true,
Computed: true,
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
ValidateFunc: validation.StringInSlice([]string{
"Windows_Client",
"Windows_Server",
}, true),
},

"vm_size": {
Expand Down Expand Up @@ -493,15 +497,6 @@ func resourceArmVirtualMachine() *schema.Resource {
}
}

func validateLicenseType(v interface{}, k string) (ws []string, errors []error) {
value := v.(string)
if value != "" && value != "Windows_Server" {
errors = append(errors, fmt.Errorf(
"[ERROR] license_type must be 'Windows_Server' or empty"))
}
return
}

func resourceArmVirtualMachineCreate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*ArmClient)
vmClient := client.vmClient
Expand Down

0 comments on commit 42baeee

Please sign in to comment.