diff --git a/nomad/resource_quota_specification.go b/nomad/resource_quota_specification.go index a7de0660..e0a4dbee 100644 --- a/nomad/resource_quota_specification.go +++ b/nomad/resource_quota_specification.go @@ -63,6 +63,11 @@ func resourceQuotaSpecificationLimits() *schema.Resource { MaxItems: 1, Elem: resourceQuotaSpecificationRegionLimits(), }, + "variables_limit": { + Description: "The maximum total size of all variables.", + Type: schema.TypeInt, + Optional: true, + }, }, } } @@ -74,10 +79,159 @@ func resourceQuotaSpecificationRegionLimits() *schema.Resource { Type: schema.TypeInt, Optional: true, }, + "cores": { + Type: schema.TypeInt, + Optional: true, + }, + "device": { + Type: schema.TypeSet, + Optional: true, + Elem: resourceQuotaSpecificationDeviceLimits(), + }, + "disk_mb": { + Type: schema.TypeInt, + Optional: true, + }, "memory_mb": { Type: schema.TypeInt, Optional: true, }, + "memory_max_mb": { + Type: schema.TypeInt, + Optional: true, + }, + "network": { + Type: schema.TypeSet, + Optional: true, + Elem: resourceQuotaSpecificationNetworkLimits(), + }, + }, + } +} + +func resourceQuotaSpecificationNetworkLimits() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "cidr": { + Type: schema.TypeString, + Optional: true, + }, + "device": { + Type: schema.TypeString, + Optional: true, + }, + "dynamic_port": { + Type: schema.TypeSet, + Optional: true, + Elem: resourceQuotaSpecificationNetworkPortLimits(), + }, + "hostname": { + Type: schema.TypeString, + Optional: true, + }, + "ip": { + Type: schema.TypeString, + Optional: true, + }, + "mode": { + Type: schema.TypeString, + Optional: true, + }, + "reserved_port": { + Type: schema.TypeSet, + Optional: true, + Elem: resourceQuotaSpecificationNetworkPortLimits(), + }, + }, + } +} + +func resourceQuotaSpecificationNetworkPortLimits() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "label": { + Type: schema.TypeString, + Required: true, + }, + "static": { + Type: schema.TypeInt, + Optional: true, + }, + "to": { + Type: schema.TypeInt, + Optional: true, + }, + "host_network": { + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +func resourceQuotaSpecificationDeviceLimits() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "affinity": { + Type: schema.TypeSet, + Optional: true, + Elem: resourceQuotaSpecificationDeviceAffinity(), + }, + "count": { + Type: schema.TypeInt, + Optional: true, + }, + "constraint": { + Type: schema.TypeSet, + Optional: true, + Elem: resourceQuotaSpecificationDeviceConstraint(), + }, + "name": { + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func resourceQuotaSpecificationDeviceConstraint() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "attribute": { + Type: schema.TypeString, + Optional: true, + }, + "operator": { + Type: schema.TypeString, + Optional: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + }, + }, + } +} + +func resourceQuotaSpecificationDeviceAffinity() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "attribute": { + Type: schema.TypeString, + Optional: true, + }, + "operator": { + Type: schema.TypeString, + Optional: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + }, + "weight": { + Type: schema.TypeInt, + Optional: true, + }, }, } } diff --git a/website/docs/r/quota_specification.html.markdown b/website/docs/r/quota_specification.html.markdown index 8536af54..a9bbc0b6 100644 --- a/website/docs/r/quota_specification.html.markdown +++ b/website/docs/r/quota_specification.html.markdown @@ -49,6 +49,9 @@ the following arguments: - `region_limit` `(block: )` - The limits to enforce. This block may only be specified once in the `limits` block. Its structure is documented below. +- `variables_limit` `(int: 0)` - The maximum total size of all + variables. A value of zero is treated as unlimited, and a negative value + is treated as fully disallowed. ### `region_limit` blocks @@ -57,6 +60,48 @@ It supports the following arguments: - `cpu` `(int: 0)` - The amount of CPU to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed. +- `cores` `(int: 0)` - +- `device` `(block: )` - +- `disk_mb` `(int: 0)` - - `memory_mb` `(int: 0)` - The amount of memory (in megabytes) to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed. +- `memory_max_mb` `(int: 0)` - +- `network` `(block: )` - + +### `device` blocks + +- `affinity` `(black: )` - +- `count` `(int: 0)` - +- `constraint` `(black: )` - +- `name` `(string: "")` - + +### `device_affinity` blocks + +- `attribute` `(string: "")` - +- `operator` `(string: "")` - +- `value` `(string: "")` - +- `weight` `(int: 0)` - + +### `device_constraint` blocks + +- `attribute` `(string: "")` - +- `operator` `(string: "")` - +- `value` `(string: "")` - + +### `network` blocks + +- `cidr` `(string: "")` - +- `device` `(string: "")` - +- `dynamic_port` `(black: )` - +- `hostname` `(string: "")` - +- `ip` `(string: "")` - +- `mode` `(string: "")` - +- `reserved_port` `(black: )` - + +### `network_port` blocks + +- `label` `(string: "")` - +- `static` `(int: 0)` - +- `to` `(int: 0)` - +- `host_network` `(string: "")` -