You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: "Maximum resource limit. Use -1 for unlimited resource limit.",
82
+
Description: "Maximum resource limit. Use -1 for unlimited resource limit. A value of 0 means zero resources are allowed, though the CloudStack API may return -1 for a limit set to 0.",
83
83
},
84
84
"projectid": {
85
85
Type: schema.TypeString,
@@ -118,7 +118,6 @@ func resourceCloudStackLimitsCreate(d *schema.ResourceData, meta interface{}) er
118
118
119
119
account:=d.Get("account").(string)
120
120
domainid:=d.Get("domainid").(string)
121
-
max:=d.Get("max").(int)
122
121
projectid:=d.Get("projectid").(string)
123
122
124
123
// Validate account and domain parameters
@@ -134,8 +133,10 @@ func resourceCloudStackLimitsCreate(d *schema.ResourceData, meta interface{}) er
134
133
ifdomainid!="" {
135
134
p.SetDomainid(domainid)
136
135
}
137
-
ifmax!=0 {
138
-
p.SetMax(int64(max))
136
+
ifmaxVal, ok:=d.GetOk("max"); ok {
137
+
maxIntVal:=maxVal.(int)
138
+
log.Printf("[DEBUG] Setting max value to %d", maxIntVal)
139
+
p.SetMax(int64(maxIntVal))
139
140
}
140
141
ifprojectid!="" {
141
142
p.SetProjectid(projectid)
@@ -226,7 +227,15 @@ func resourceCloudStackLimitsRead(d *schema.ResourceData, meta interface{}) erro
Copy file name to clipboardExpand all lines: website/docs/d/limits.html.markdown
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,6 @@ The following arguments are supported:
49
49
*`memory`
50
50
*`primarystorage`
51
51
*`secondarystorage`
52
-
*`publicip`
53
-
*`eip`
54
-
*`autoscalevmgroup`
55
52
*`account` - (Optional) List resources by account. Must be used with the `domainid` parameter.
56
53
*`domainid` - (Optional) List only resources belonging to the domain specified.
57
54
*`projectid` - (Optional) List resource limits by project.
@@ -63,7 +60,7 @@ The following attributes are exported:
63
60
*`limits` - A list of resource limits. Each limit has the following attributes:
64
61
*`resourcetype` - The type of resource.
65
62
*`resourcetypename` - The name of the resource type.
66
-
*`max` - The maximum number of the resource.
63
+
*`max` - The maximum number of the resource. A value of `-1` indicates unlimited resources. A value of `0` means zero resources are allowed, though the CloudStack API may return `-1` for a limit set to `0`.
67
64
*`account` - The account of the resource limit.
68
65
*`domain` - The domain name of the resource limit.
69
66
*`domainid` - The domain ID of the resource limit.
Copy file name to clipboardExpand all lines: website/docs/r/limits.html.markdown
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,13 +58,10 @@ The following arguments are supported:
58
58
*`memory`
59
59
*`primarystorage`
60
60
*`secondarystorage`
61
-
*`publicip`
62
-
*`eip`
63
-
*`autoscalevmgroup`
64
61
65
62
*`account` - (Optional, ForceNew) Update resource for a specified account. Must be used with the `domainid` parameter.
66
63
*`domainid` - (Optional, ForceNew) Update resource limits for all accounts in specified domain. If used with the `account` parameter, updates resource limits for a specified account in specified domain.
67
-
*`max` - (Optional) Maximum resource limit. Use `-1` for unlimited resource limit.
64
+
*`max` - (Optional) Maximum resource limit. Use `-1` for unlimited resource limit. A value of `0` means zero resources are allowed, though the CloudStack API may return `-1` for a limit set to `0`.
68
65
*`projectid` - (Optional, ForceNew) Update resource limits for project.
0 commit comments