Open rsealsovtech opened 1 year ago
Thanks @rsealsovtech, I didn't realise that backend config files could be in json format. Can you share what such a file looks like?
Going by the docs, Terraform supports JSON syntax with .json
suffix, e.g., .tf.json
and .tfvars.json
. This is useful for feeding in programmatically-generated JSON output prepared by other software.
For our "backend_config_file" example, that can look like:
# backend.tfbackend
bucket = "terraform-aws-rdhar"
dynamodb_table = "terraform-aws-rdhar"
key = "terraform.tfstate"
region = "us-east-1"
# backend.tfbackend.json
{
"bucket": "terraform-aws-rdhar",
"dynamodb_table": "terraform-aws-rdhar",
"key": "terraform.tfstate",
"region": "us-east-1"
}
I thought this was my problem, but actually my solution was to just not specify the backend config file. That works in the case of .tf.json files, where a backend file would start with
{
"terraform": {
"backend": {
...
Problem description
Previously I was using a json formatted back-end file. On Friday suddenly
terraform plan
started throwing errors about not expecting a Left brace. I updated the name of the file to exclude.json
and changed the syntax to HCL and it worked.I did test a
plan
andapply
locally with the samejson
files and received no syntax errors.Terraform version
1.3.6
Backend
s3
Workflow YAML
Workflow log