Update variable interpolation for hcl
This commit is contained in:
@@ -50,7 +50,9 @@ You can configure the timezone for the container by passing a `TZ` env variable.
|
|||||||
|
|
||||||
## Configuring
|
## Configuring
|
||||||
|
|
||||||
In this repo, you can explore the `sample-config.hcl` file for an example, but the general structure is as follows. It should be noted that environment variable interpolation happens on load of the HCL file.
|
In this repo, you can explore the `sample-config.hcl` file for an example, but the general structure is as follows. If you are passing environment variables to your commands or alerts, you should be aware that `${VAR}` syntax is reserved for HCL variable interpolation. To avoid issues, you can use `$${VAR}` syntax to escape the `$` character, simply use `$VAR`.
|
||||||
|
|
||||||
|
```hcl
|
||||||
|
|
||||||
The global configurations are:
|
The global configurations are:
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -38,15 +38,15 @@ alert "mailgun_down" {
|
|||||||
-F to=me@minitor.mon \
|
-F to=me@minitor.mon \
|
||||||
-F text="Our monitor failed" \
|
-F text="Our monitor failed" \
|
||||||
https://api.mailgun.net/v3/minitor.mon/messages \
|
https://api.mailgun.net/v3/minitor.mon/messages \
|
||||||
-u "api:${MAILGUN_API_KEY}"
|
-u "api:$${MAILGUN_API_KEY}"
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
alert "sms_down" {
|
alert "sms_down" {
|
||||||
shell_command = <<-EOF
|
shell_command = <<-EOF
|
||||||
curl -s -X POST -F "Body=Failure! {{.MonitorName}} has failed" \
|
curl -s -X POST -F "Body=Failure! {{.MonitorName}} has failed" \
|
||||||
-F "From=${AVAILABLE_NUMBER}" -F "To=${MY_PHONE}" \
|
-F "From=$${AVAILABLE_NUMBER}" -F "To=$${MY_PHONE}" \
|
||||||
"https://api.twilio.com/2010-04-01/Accounts/${ACCOUNT_SID}/Messages" \
|
"https://api.twilio.com/2010-04-01/Accounts/$${ACCOUNT_SID}/Messages" \
|
||||||
-u "${ACCOUNT_SID}:${AUTH_TOKEN}"
|
-u "$${ACCOUNT_SID}:$${AUTH_TOKEN}"
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user