This article outlines a configuration issue which can cause Terraform deployment failures
“Terraform plan failure: Invalid value for input variable”.
Error: Invalid value for input variable
on /tmp/vra-tf-secrets/terraform.tfvars.json line 23:
23: "tags" : "{ Project = \"Test\"}",
The given value is not valid for variable "tags": map of string required.
The issue is caused by serializing an object as a string and sending it to Terraform when Terraform is expecting a map of strings.
The input variable in the yaml is a string. Example:
tags:
type: string
description: A map of tags to use for the instance.
Used in the yaml with to_string for example:
tags: ${to_string(input.tags)}
To resolve the issue remove the to_string
tags: {input.tags}
Terraform is expecting a map of strings. Once you remove the to_string a valid json object is then sent to terraform.