Job

NomadJob

The nomad_job resource allows you to apply one or more Nomad job files to a cluster.

Jumppad monitors changes to the jobs defined in the paths property and automatically recreates this resource when jumppad up is called.


resource "nomad_job" "name" {
  ...
}

Attributes

Attribute
Description

Cluster cluster required type: Reference to Cluster

The reference to a cluster to apply the jobs to. Nomad jobs are only applied when the referenced cluster is created and healthy.

cluster = resource.nomad_cluster.dev

Paths paths required type: []string

Paths to the Nomad job files to apply to the cluster.

paths = ["./files/nomad", "./nomad/job.hcl"]

HealthCheck health_check type: block HealthCheckNomad

Optional health check to perform after the jobs have been applied, this resource will not complete until the health checks are passing.

health_check {
  timeout = "60s"
  jobs = ["redis"]
}

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Attribute
Description

Meta ID meta.id string

The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting id will be
resource.container.ubuntu

Meta Type meta.type string

The type of the resource. This taken from the type label of the resource definition.

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting type will be
container

Meta Name meta.name string

The name of the resource. This taken from the name label of the resource definition.

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting name will be
ubuntu


HealthCheckNomad


health_check {
  ...
}

Attributes

Attribute
Description

Timeout timeout required type: string

Timeout expressed as a go duration i.e 10s

timeout = "60s"

Jobs jobs required type: []string

The jobs to check the status of.

jobs = ["redis"]

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Last updated