Create a gist now

Instantly share code, notes, and snippets.

@Mongey /foobar.tf Secret
Last active May 14, 2017

What would you like to do?
Vault Terraform Example
resource "vault_auth_backend" "github" {
type = "github"
}
resource "vault_generic_secret" "github_org" {
path = "auth/github/config"
depends_on = ["vault_auth_backend.github"]
data_json = <<EOT
{
"organization" : "FundingCircle"
}
EOT
}
resource "vault_policy" "app_secrets_read" {
name = "app_read"
policy = <<EOT
path "secret/my_app" {
policy = "read"
}
EOT
}
resource "vault_generic_secret" "github_infra_team" {
path = "auth/github/map/teams/infrastructure"
depends_on = ["vault_generic_secret.github_org"]
data_json = <<EOT
{
"value": "app_read"
}
EOT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment