Giter Site home page Giter Site logo

Comments (1)

usererror avatar usererror commented on August 15, 2024

@wjam Not sure if you're still looking for a solution here but I ran into the same exact problem with github auth. One pure tf solution that currently works is to use a null resource to do the configuration instead of a vault_generic_secret directly:

# main.tf of a module called null-write i use to get around this issue
resource "null_resource" "config" {
  triggers = {
    path = "${var.path}"
    data = "${var.data}"
  }

  provisioner "local-exec" {
    command = "echo '${var.data}' | vault write ${var.path} -"
  }
}

which you would use like so... (the data must be json, you can use the builtin jsonencode function along with the builtin list/map funcs to build the data properly)

# main.tf of a module using the null-write module to configure an auth backend
resource "vault_auth_backend" "backend" {
  type        = "${var.type}"
  path        = "${var.path}"
  description = "${var.description}"
}

# you could repeat this block numerous times to create multiple approle roles etc.
module "config" {
  source = "../null-write"
  
  path = "${var.config_path}"
  data = "${var.config_data}"
}

Unfortunately this is much less obvious than using the generic secret resource and many people are unfamiliar with null_resource. It would be nice if we could configure the auth backends directly in a cleaner way. It really comes down to just writing json data to a path, but some auth backends like approle may require more than one k=v configuration (multiple roles for example).

from terraform-provider-vault.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.