hashicorp / consul-template

Template rendering, notifier, and supervisor for @HashiCorp Consul and Vault data.
https://www.hashicorp.com/
Mozilla Public License 2.0
4.76k stars 780 forks source link

[documentation] It is not clear which commands are described #1809

Open EugenKon opened 1 year ago

EugenKon commented 1 year ago

https://github.com/hashicorp/consul-template#commands

I do not understand which commands are described and how to use them.

Particularly, I want to fetch value from aws secret manager: aws secretsmanager get-secret-value --secret-id ${PROJECT_NAME}/path --region ${AWS_REGION}. Is next possible?

job{ group { task {
      template {
        data = <<-EOH
          {{- with exec "aws secretmanager ..." -}}
          PGPASSWORD="{{ .Data.password }}"
          PGUSER="{{ .Data.user }}"
          PGDATABASE="{{ .Data.db }}"
          {{ end }}

        EOH
        destination = "secrets/file.env"
        env         = true
}}}
blake commented 6 months ago

Hi @EugenKon, you might want to take a look at the plugin function. This would allow you to write a script that executes the aws secretmanager command and allows the output to be used within consul-template.

EugenKon commented 6 months ago

@blake Interesting. Thank you, I'll look at it.