Added Group attribute to cloudstack instance resource

This commit is contained in:
Jeff LaPlante 2016-04-05 09:12:45 -07:00
parent 75bd44e29d
commit cf607e8a58
1 changed files with 11 additions and 0 deletions

View File

@ -93,6 +93,12 @@ func resourceCloudStackInstance() *schema.Resource {
Optional: true,
Default: false,
},
"group": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},
},
}
}
@ -193,6 +199,11 @@ func resourceCloudStackInstanceCreate(d *schema.ResourceData, meta interface{})
p.SetUserdata(ud)
}
// If there is a group supplied, add it to the parameter struct
if group, ok := d.GetOk("group"); ok {
p.SetGroup(group.(string))
}
// Create the new instance
r, err := cs.VirtualMachine.DeployVirtualMachine(p)
if err != nil {