Created
May 16, 2022 15:10
-
-
Save tbeyer567/67bfd011a1cb3de09462a9f14734b0df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path "auth/approle/role/agent/role-id" { | |
capabilities=["read"] | |
} | |
path "auth/approle/role/agent/secret-id" { | |
capabilities=["read","update"] | |
} | |
path "kv/data/application/db01" { | |
capabilities=["read"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ with secret "kv/data/application/db01" }} | |
password: {{ .Data.data.password }} | |
{{ end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vault { | |
address = "https://vault:8200" | |
} | |
auto_auth { | |
method "approle" { | |
mount_path = "auth/approle" | |
config = { | |
role_id_file_path = "creds/role-id" | |
secret_id_file_path = "creds/secret-id" | |
# Helpful to accelerate testing vault agent config | |
# Default is true | |
remove_secret_id_file_after_reading = false | |
} | |
} | |
sink "file" { | |
wrap_ttl = "5m" | |
config = { | |
path = "creds/vault-token" | |
} | |
} | |
} | |
# Get db pass | |
template { | |
source = "application/db_pass.ctmpl" | |
destination = "application/db_pass.txt" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment