Skip to content

Instantly share code, notes, and snippets.

@Mongey

Mongey/foobar.tf Secret

Last active May 14, 2017 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mongey/e3c0159ba9e484c5493e4b06168f9ba1 to your computer and use it in GitHub Desktop.
Save Mongey/e3c0159ba9e484c5493e4b06168f9ba1 to your computer and use it in GitHub Desktop.
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