mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Added Group attribute to cloudstack instance resource
This commit is contained in:
parent
75bd44e29d
commit
cf607e8a58
@ -93,6 +93,12 @@ func resourceCloudStackInstance() *schema.Resource {
|
|||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
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)
|
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
|
// Create the new instance
|
||||||
r, err := cs.VirtualMachine.DeployVirtualMachine(p)
|
r, err := cs.VirtualMachine.DeployVirtualMachine(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user