Terraformed dead Nomad Jobs not restarting

Is this the proper channel for talking about the terraform nomad provider?
I’m seeing a weird case in our environment where i stopped a nomad job (dead) and ran the terraform script but it says the infrastructure is up to date even though the job is dead
in the past i’ve tainted the job but an wondering if this is a bug / misconfiguration on my part

The steps to replicate are:

  1. In the Nomad UI click [ Stop ] on a job.
  2. Job is now listed as [DEAD ]
  3. In Terraform attempt to re-apply the Nomad job that looks like this:
data "template_file" "environment" {
  template = "${file("${path.module}/environment.nomad")}"

  vars {
    aws_region    = "${var.region}"
    datacenter    = "${var.datacenter}"
    subdomain     = "${var.subdomain}"
    version_label = "${var.version_label}"
    vpc_name      = "${var.vpc_name}"

resource "nomad_job" "environment" {
  jobspec = "${data.template_file.environment.rendered}"

After about 10 minutes the job went from DEAD to no longer showing up in the :4646/ui/jobs UI. Once it stopped showing up the Terraform provider allowed the job to get re-created. Is there any way to short-circuit this de-registeration process?

This is a known issue with this provider:

1 Like