--- layout: "docs" page_title: "resources Stanza - Job Specification" sidebar_current: "docs-job-specification-resources" description: |- The "resources" stanza describes the requirements a task needs to execute. Resource requirements include memory, disk space, network, cpu, and more. --- # `resources` Stanza
Placement |
job -> group -> task -> **resources**
|
---|
([Network][]: required)
- Specifies the network
requirements, including static and dynamic port allocations.
## `resources` Examples
The following examples only show the `resources` stanzas. Remember that the
`resources` stanza is only valid in the placements listed above.
### Disk Space
This example specifies the task requires 100MB of disk space to operate:
```hcl
resources {
disk = 100
}
```
### Memory
This example specifies the task requires 2GB of RAM to operate. 2GB is the
equivalent of 2000MB:
```hcl
resources {
memory = 2000
}
```
### Network
This example shows network constraints as specified in the [network][] stanza
which require 1GBit of bandwidth, dynamically allocates two ports, and
statically allocates one port:
```hcl
resources {
network {
mbits = 1000
port "http" {}
port "https" {}
port "lb" {
static = "8889"
}
}
}
```
[network]: /docs/job-specification/network.html "Nomad network Job Specification"