diff --git a/builtin/providers/cloudstack/resource_cloudstack_instance.go b/builtin/providers/cloudstack/resource_cloudstack_instance.go index 05898dc23..315b99ad3 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_instance.go +++ b/builtin/providers/cloudstack/resource_cloudstack_instance.go @@ -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 {