forked from tellerops/teller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwizard_template.go
260 lines (222 loc) · 6.1 KB
/
wizard_template.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
package pkg
var TellerFileTemplate = `
project: {{.Project}}
{{- if .Confirm }}
confirm: Are you sure you want to run on {{"{{stage}}"}}?
{{ end }}
# Set this if you want to carry over parent process' environment variables
# carry_env: true
#
# Variables
#
# Feel free to add options here to be used as a variable throughout
# paths.
#
opts:
region: env:AWS_REGION # you can get env variables with the 'env:' prefix, for default values if env not found use comma. Example: env:AWS_REGION,{DEFAULT_VALUE}
stage: development
#
# Providers
#
providers:
{{- if index .ProviderKeys "heroku" }}
# requires an API key in: HEROKU_API_KEY (you can fetch yours from ~/.netrc)
heroku:
# sync a complete environment
env_sync:
path: drakula-demo
# # pick and choose variables
# env:
# JVM_OPTS:
# path: drakula-demo
{{end}}
{{- if index .ProviderKeys "vercel" }}
# requires an API token in: VERCEL_TOKEN
vercel:
# sync a complete environment
env_sync:
path: drakula-demo
# # pick and choose variables
# env:
# JVM_OPTS:
# path: drakula-demo
{{end}}
{{- if index .ProviderKeys "hashicorp_vault" }}
# configure only from environment
# https://github.com/hashicorp/vault/blob/api/v1.0.4/api/client.go#L28
# this vars should not go through to the executing cmd
hashicorp_vault:
env_sync:
path: secret/data/{{"{{stage}}"}}/billing/web/env
env:
SMTP_PASS:
path: secret/data/{{"{{stage}}"}}/wordpress
field: smtp
{{end}}
{{- if index .ProviderKeys "aws_secretsmanager" }}
# configure only from environment
aws_secretsmanager:
env_sync:
path: prod/foo/bar
env:
FOO_BAR:
path: prod/foo/bar
field: SOME_KEY
{{end}}
{{- if index .ProviderKeys "aws_ssm" }}
# configure only from environment
aws_ssm:
env:
FOO_BAR:
path: /prod/foobar
decrypt: true
{{end}}
{{- if index .ProviderKeys "google_secretmanager" }}
# GOOGLE_APPLICATION_CREDENTIALS=foobar.json
# https://cloud.google.com/secret-manager/docs/reference/libraries#setting_up_authentication
google_secretmanager:
env:
FOO_GOOG:
# need to supply the relevant version (versions/1)
path: projects/123/secrets/FOO_GOOG/versions/1
{{end}}
{{- if index .ProviderKeys "etcd" }}
# Configure via environment:
# ETCDCTL_ENDPOINTS
# tls:
# ETCDCTL_CA_FILE
# ETCDCTL_CERT_FILE
# ETCDCTL_KEY_FILE
etcd:
env_sync:
path: /prod/foo
env:
ETC_DSN:
path: /prod/foo/bar
{{end}}
{{- if index .ProviderKeys "consul" }}
# Configure via environment:
# CONSUL_HTTP_ADDR
consul:
env_sync:
path: redis/config
env:
ETC_DSN:
path: redis/config/foobar
{{end}}
{{- if index .ProviderKeys "dotenv" }}
# you can mix and match many files
dotenv:
env_sync:
path: ~/my-dot-env.env
env:
FOO_BAR:
path: ~/my-dot-env.env
{{end}}
{{- if index .ProviderKeys "azure_keyvault" }}
# you can mix and match many files
azure_keyvault:
env_sync:
path: azure
env:
FOO_BAR:
path: foobar
{{end}}
{{- if index .ProviderKeys "doppler" }}
# set your doppler project with "doppler configure set project <my-project>"
doppler:
env_sync:
path: prd
env:
FOO_BAR:
path: prd
{{end}}
{{- if index .ProviderKeys "cyberark_conjur" }}
# https://conjur.org
# set CONJUR_AUTHN_LOGIN and CONJUR_AUTHN_API_KEY env vars
# set .conjurrc file in user's home directory
cyberark_conjur:
env:
FOO_BAR:
path: /secrets/foo/bar
{{end}}
{{- if index .ProviderKeys "1password" }}
# Configure via environment variables:
# OP_CONNECT_HOST
# OP_CONNECT_TOKEN
1password:
env_sync:
path: # Key title
source: # 1Password token gen include access to multiple vault. to get the secrets you must add and vaultUUID. the field is mandatory
env:
FOO_BAR:
path: # Key title
source: # 1Password token gen include access to multiple vault. to get the secrets you must add and vaultUUID. the field is mandatory
field: # The secret field to get. notesPlain, {label key}, password etc.
{{end}}
{{- if index .ProviderKeys "gopass" }}
# Override default configuration: https://github.com/gopasspw/gopass/blob/master/docs/config.md
gopass:
env_sync:
path: foo
env:
ETC_DSN:
path: foo/bar
{{end}}
{{- if index .ProviderKeys "lastpass" }}
# Configure via environment variables:
# LASTPASS_USERNAME
# LASTPASS_PASSWORD
lastpass:
env_sync:
path: # LastPass item ID
env:
ETC_DSN:
path: # Lastpass item ID
# field: by default taking password property. in case you want other property un-mark this line and set the lastpass property name.
{{end}}
{{- if index .ProviderKeys "cloudflare_workers_secrets" }}
# Configure via environment variables for integration:
# CLOUDFLARE_API_KEY: Your Cloudflare api key.
# CLOUDFLARE_API_EMAIL: Your email associated with the api key.
# CLOUDFLARE_ACCOUNT_ID: Your account ID.
cloudflare_workers_secrets:
env_sync:
source: # Mandatory: script field
env:
script-value:
path: foo-secret
source: # Mandatory: script field
{{end}}
{{- if index .ProviderKeys "github" }}
# Configure via environment variables for integration:
# GITHUB_AUTH_TOKEN: GitHub token
github:
env_sync:
path: owner/github-repo
env:
script-value:
path: owner/github-repo
{{end}}
{{- if index .ProviderKeys "keypass" }}
# Configure via environment variables for integration:
# KEYPASS_PASSWORD: KeyPass password
# KEYPASS_DB_PATH: Path to DB file
keypass:
env_sync:
path: redis/config
# source: Optional, all fields is the default. Supported fields: Notes, Title, Password, URL, UserName
env:
ETC_DSN:
path: redis/config/foobar
# source: Optional, Password is the default. Supported fields: Notes, Title, Password, URL, UserName
{{end}}
{{- if index .ProviderKeys "filesystem" }}
filesystem:
env_sync:
path: redis/config
env:
ETC_DSN:
path: redis/config/foobar
{{end}}
`