IBM Cloud Docs
Why can't I validate my Terraform template?

Why can't I validate my Terraform template?

When you try to add a Terraform template to your private catalog, the validation process fails because the correct version of the Terraform template isn't specified.

The following error is displayed when you try to validate that the Terraform template can be installed on the target infrastructure:

Error: Error parsing /file-path/main.tf: At 9:14: Unknown token : 9:14 IDENT var.resource_group

The Terraform version that you specify during the validation process is incorrect. You might be specifying a version of Terraform that's used when you run stand-alone IBM Cloud Schematics.

To specify the Terraform version to use during the validation process, complete the following steps:

  1. Add a variable to your Terraform template as shown in the following example:

    variable "TF_VERSION" {
    description = "terraform version."
    default = 0.13
    }
    
  2. After you import your Terraform template to your private catalog, add the template version as a deployment value that's hidden from users when they install the software.