Feature
#103 #107 add template variables
The following variables are added.
- ChangedResult
- ChangeOutsideTerraform
- Warning
Compared with CombinedOutput
, we can make the result of terraform plan
clear.
- We can exclude noisy
Refreshing state...
logs - Separate
changes made outside of Terraform since the last "terraform apply":
- Make the warning easy to see
Variable: ChangedResult
{{if .ChangedResult}}
<details><summary>Change Result (Click me)</summary>
{{wrapCode .ChangedResult}}
</details>
{{end}}
Variable: ChangeOutsideTerraform
{{if .ChangeOutsideTerraform}}
<details><summary>:warning: Note: Objects have changed outside of Terraform</summary>
{{wrapCode .ChangeOutsideTerraform}}
</details>
{{end}}
Variable: Warning
{{if .Warning}}
## :warning: Warnings :warning:
{{wrapCode .Warning}}
{{end}}
Example configuration
---
templates:
changed_result: |
{{if .ChangedResult}}
<details><summary>Change Result (Click me)</summary>
{{wrapCode .ChangedResult}}
</details>
{{end}}
change_outside_terraform: |
{{if .ChangeOutsideTerraform}}
<details><summary>:warning: Note: Objects have changed outside of Terraform</summary>
{{wrapCode .ChangeOutsideTerraform}}
</details>
{{end}}
warning: |
{{if .Warning}}
## :warning: Warnings :warning:
{{wrapCode .Warning}}
{{end}}
error_message: |
{{if .ErrorMessages}}
## :warning: Errors
{{range .ErrorMessages}}
* {{. -}}
{{- end}}{{end}}
terraform:
plan:
template: |
{{template "plan_title" .}}
{{if .Link}}[CI link]({{.Link}}){{end}}
{{template "result" .}}
{{template "updated_resources" .}}
{{template "changed_result" .}}
{{template "change_outside_terraform" .}}
{{template "warning" .}}
{{template "error_message" .}}
when_destroy:
template: |
{{template "plan_title" .}}
{{if .Link}}[CI link]({{.Link}}){{end}}
{{template "deletion_warning" .}}
{{template "result" .}}
{{template "updated_resources" .}}
{{template "changed_result" .}}
{{template "change_outside_terraform" .}}
{{template "warning" .}}
{{template "error_message" .}}