Skip to content

Simplified confd that only has ssm as a backend, no config, stdin and out only.

License

Notifications You must be signed in to change notification settings

davidrjonas/ssm-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssm-template

A simple template renderer with support for AWS Systems Manager Parameter Store. Based on the venerable confd, dramatically simplified, adding Masterminds sprig functions.

Resources

Usage

There are no options or configuration. AWS credentials are set in the usual way via ~/.aws/credentials and environment variables.

Read from STDIN, write to STDOUT, errors to STDERR, exit code set.

$ cat <<EOF > my.conf.tpl
Sprig now: {{ now }}
confd getenv: {{ getenv "HOME" }}

{{ with get "/config/host" -}}
confd get: {{ .Key }}={{ .Value }}
{{- end }}

confd gets:
{{- range gets "/config" }}
- key: {{ .Key }}
  value: {{ .Value }}
{{- end }}
EOF

$ AWS__REGION=us-west-1 ssm-template < my.conf.tpl | tee my.conf
Sprig now: 2019-02-22 14:32:51.121105 -0800 PST m=+0.039965546
confd getenv: /Users/djonas

confd get: /config/host=127.0.0.1

confd gets:
- key: /config/host
  value: 127.0.0.1
- key: /config/port
  value: 80