Skip to content

Commit a653531

Browse files
authored
added domainid parameter to account resource (#136)
1 parent 02058b4 commit a653531

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cloudstack/resource_cloudstack_account.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ func resourceCloudStackAccount() *schema.Resource {
6666
Type: schema.TypeString,
6767
Optional: true,
6868
},
69+
"domainid": {
70+
Type: schema.TypeString,
71+
Optional: true,
72+
},
6973
},
7074
}
7175
}
@@ -80,6 +84,7 @@ func resourceCloudStackAccountCreate(d *schema.ResourceData, meta interface{}) e
8084
role_id := d.Get("role_id").(string)
8185
account_type := d.Get("account_type").(int)
8286
account := d.Get("account").(string)
87+
domainid := d.Get("domainid").(string)
8388

8489
// Create a new parameter struct
8590
p := cs.Account.NewCreateAccountParams(email, first_name, last_name, password, username)
@@ -90,6 +95,7 @@ func resourceCloudStackAccountCreate(d *schema.ResourceData, meta interface{}) e
9095
} else {
9196
p.SetAccount(username)
9297
}
98+
p.SetDomainid(domainid)
9399

94100
log.Printf("[DEBUG] Creating Account %s", account)
95101
a, err := cs.Account.CreateAccount(p)

website/docs/r/account.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ The following arguments are supported:
3636
* `account_type` - (Required) The account type. Possible values are `0` for regular user, `1` for admin, and `2` for domain admin.
3737
* `role_id` - (Required) The ID of the role associated with the account.
3838
* `account` - (Optional) The account name. If not specified, the username will be used as the account name.
39+
* `domainid` - (Optional) Creates the user under the specified domain
3940

4041
## Attributes Reference
4142

0 commit comments

Comments
 (0)