Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[request] support for Nomad 1.4 secure variables #288

Closed
shantanugadgil opened this issue Sep 15, 2022 · 11 comments
Closed

[request] support for Nomad 1.4 secure variables #288

shantanugadgil opened this issue Sep 15, 2022 · 11 comments

Comments

@shantanugadgil
Copy link
Contributor

Terraform Version

1.2.9

Provider Version

1.4.18

Nomad Version

Nomad v1.4.0-beta.1 (d17021a366178a11b79353f13735389629102d6a)

Provider Configuration

N/A

When can we get the support for the secure variables in the terraform provider?

The secure variables are a very welcome addition (instead of setting up Vault only for the KV backend)

In our workflow, we would like to use Terraform to inject/update the secure variables into Nomad.
NOTE: The access to the repo of secrets would of course be a "very limited access"

@tgross
Copy link
Member

tgross commented Sep 15, 2022

Hi @shantanugadgil! We anticipate shipping TF support following 1.4.0 GA.

@iluminae
Copy link
Contributor

@tgross any timeline on this? Looking forward to migrating from vault kv to nomad variables but need to control them with tf.

@HINT-SJ
Copy link

HINT-SJ commented Oct 27, 2022

Nomad 1.4.1 is already out, still no (documented) support? :(

@jrasell
Copy link
Member

jrasell commented Oct 27, 2022

Hi @iluminae and @HINT-SJ, the team balances a lot of work-streams and priorities which has meant we have not had the time to start this work quite yet. We will update this issue once we have started work and appreciate your patience.

@HINT-SJ
Copy link

HINT-SJ commented Oct 28, 2022

For anyone reading this, for the meantime I'm using a little workaround:

resource "null_resource" "nomad_var_put" {
  triggers = {
    job_name    = local.nomad_job_name
    db_username = var.name
    db_password = random_string.pass.result
  }

  provisioner "local-exec" {
    command = "nomad var put nomad/jobs/${self.triggers.job_name} db_username=\"${self.triggers.db_username}\" db_password=\"${self.triggers.db_password}\""
  }

  provisioner "local-exec" {
    when    = destroy
    command = "nomad var purge nomad/jobs/${self.triggers.job_name}"
  }
}

Just make sure the current session is logged in to the correct nomad cluster :)

@IamTheFij
Copy link
Contributor

In addition to setting the variables, it would be great to have the ability to pass Job ACLs as well. The base client supports this already.

@lgfa29
Copy link
Contributor

lgfa29 commented Dec 1, 2022

Hi @IamTheFij, would you be able to explain a little more what you mean by pass Job ACLs? Is this related to Nomad variables?

@IamTheFij
Copy link
Contributor

Yes, it's related to Variables. As far as I can tell, the ability to assign an ACL to a workload was added to provide Variable access to Jobs and Tasks. https://developer.hashicorp.com/nomad/docs/concepts/variables. The Go API already allows optionally passing this information along with an ACL, but it's not yet possible with Terraform.

@regner
Copy link
Contributor

regner commented Feb 9, 2023

I didn't fully read the comments on this issue before creating a new issue, but what @IamTheFij is talking is the same thing I requested in #306.

@Borsty
Copy link

Borsty commented May 5, 2023

Still no progress on this? We're already on nomad 1.5 :'(

-edit-
Looks like someone has been busy: #325 :)

@lgfa29
Copy link
Contributor

lgfa29 commented Jun 5, 2023

Implemented in #325.

Thank you very much @regner and @iluminae 🙂

@lgfa29 lgfa29 closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants