hashicorp / terraform-provider-nomad

Terraform Nomad provider
https://registry.terraform.io/providers/hashicorp/nomad/latest
Mozilla Public License 2.0
139 stars 102 forks source link

nomad-pack integtation #409

Open jorgemarey opened 6 months ago

jorgemarey commented 6 months ago

I'll be nice to have a terraform reource to manage nomad-pack templates.

Nomad-pack made nomad jobs reusable by providing a templating mechanism, but currently there's no "standard" way of storing nomad-pack deployments as code. You can always save the version and registry and run a bash command, but that's not very elegant.

Having a nomad-pack resource on terraform could have the following improvements:

The resource could be something like this:

resource "nomad_pack" "autoscaler" {
  name            = "autoscaler"
  pack_name       = "autoscaler"
  revision        = "v0.3.7"
  namespace       = var.namespace
  preserve_counts = true
  vars = {
    job_name          = var.job_name
    target            = "aws-asg"
    region            = var.region
    config_path       = var.config_path
  }

To set the diff, maybe it could be usefull to store in terraform the rendered job and use that for the diff.

ednxzu commented 1 month ago

Hey ! any news on this feature ? :) would be very cool to use !