Skip to content

Instantly share code, notes, and snippets.

@mitchelldavis
Last active August 23, 2018 12:54
Show Gist options
  • Save mitchelldavis/28f9d50e21297f6774376c11b407a686 to your computer and use it in GitHub Desktop.
Save mitchelldavis/28f9d50e21297f6774376c11b407a686 to your computer and use it in GitHub Desktop.
This Gist is a reference on how to use Terraform's null_resource to apply configuration to Vault when the configuration endpoint doesn't define all of the expected http methods. (GET, PUT, POST, DELETE)
resource "null_resource" "secret_tune" {
triggers {
config_content = "${sha512("${file("data/sys/mounts/secret/tune.json")}")}"
}
provisioner "local-exec" {
command = "curl -X POST -H \"X-VAULT-TOKEN:$VAULT_TOKEN\" -d '${file("data/sys/mounts/secret/tune.json")}' $VAULT_ADDR/v1/sys/mounts/secret/tune"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment