You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When declaring a map in JSON format in a Terraform variable file, it produces the error:
...
💡 [landing_zone_route_table_association] terraform plan -no-color -var-file='/root/.terrahub/cache/jit/landing_zone_route_table_association_eef16dcf/default.tfvars' -var-file='/root/.terrahub/cache/jit/landing_zone_route_table_association_eef16dcf/remote.tfvars' -out=/root/.terrahub/cache/jit/landing_zone_route_table_association_eef16dcf/terraform.tfplan -input=false
❌ [landing_zone_route_table_association] invalid value "/root/.terrahub/cache/jit/landing_zone_route_table_association_eef16dcf/default.tfvars" for flag -var-file: multiple map declarations not supported for variables
❌ [landing_zone_route_table_association] Usage: terraform plan [options] [DIR-OR-PLAN]
Generates an execution plan for Terraform.
This execution plan can be reviewed prior to running apply to get a
sense for what Terraform will do. Optionally, the plan can be saved to
a Terraform plan file, and apply can take this plan file to execute
this plan exactly.
If a saved plan is passed as an argument, this command will output
the saved plan contents. It will not modify the given plan.
...
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.aws_vpc.selected[1]: Refreshing state...
data.aws_vpc.selected[0]: Refreshing state...
------------------------------------------------------------------------
No changes. Infrastructure is up-to-date.
This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
The text was updated successfully, but these errors were encountered:
NOT relevant anymore and NOT waiting for this problem to be solved by terraform.
intermediary solutions:
define JSON maps as empty objects in default.tfvars and pass map's values in HCL format using another tfvars file like config.tfvars; run terraform apply -var-file=default.tfvars -var-file=config.tfvars, respecting variables precedence (ONLY for terraform v0.11.x and below)
switch from JSON to HCL or HCL2 (currently work in progress for terrahub cli; will be published soon, in the next couple of weeks)
Bug Report
Parsing of maps in JSON variable files is broken.
Describe the Bug
When declaring a map in JSON format in a Terraform variable file, it produces the error:
To Reproduce
Error
component config file
.terrahub.yml
tfvars file
../tfvars/landing_zone_route_table_association/default.tfvars
in HCL formattfvars file
default.tfvars
in JSON formatrun command
To Reproduce
Without Error
main.tf
variable.tf
default.tfvars
run command
output without error
The text was updated successfully, but these errors were encountered: