Closed sonatard closed 6 days ago
Thank you for your report!
tfcmt.yaml
terraform:
templates:
error_message: |
{{if .ErrorMessages}}
## :warning: Errors
{{range .ErrorMessages}}
* {{. -}}
{{- end}}{{end}}
plan:
template: |
{{template "error_message" .}}
main.tf
resource "null_resource" "foo" {}
terraform init
$ tfcmt plan -- terraform plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# null_resource.foo will be created
+ resource "null_resource" "foo" {
+ id = (known after apply)
}
Plan: 1 to add, 0 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.
ERRO[0001] tfcmt failed error="html/template:default:1:11: no such template \"error_message\""
templates:
error_message: |
{{if .ErrorMessages}}
## :warning: Errors
{{range .ErrorMessages}}
* {{. -}}
{{- end}}{{end}}
terraform:
plan:
template: |
{{template "error_message" .}}
I found the document is wrong.
This was my misunderstanding. The document is correct.
tfcmt version
Environment
Overview
I set up the configuration referring to the example, but it resulted in an error.
https://suzuki-shunsuke.github.io/tfcmt/config#example-configuration
How to reproduce
Debug output
Expected behaviour
no error
Actual behaviour
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now. time="2024-11-23T16:41:33Z" level=error msg="tfcmt failed" error="html/template:default:12:11: no such template \"error_message\"" Error: Process completed with exit code 1.
Important Factoids
No response
Note
No response