IBM Cloud Schematics: How do I upgrade the runtime from Terraform v0.12 to v0.13?

131 views Asked by At

I am using IBM Cloud Schematics with a workspace based on Terraform 0.12. Based on the changelog a new Terraform version is supported by the runtime. How do I change my workspace to use the new runtime?

2

There are 2 answers

1
Vidyasagar Machupalli On

Have you tried with the below versions.tf file added to your repo. This should work for both Terraform version 0.12 and 0.13.

terraform {
  required_providers {
    ibm = {
      source = "IBM-Cloud/ibm"
      version = ">= 1.12.0"
    }
  }
  required_version = ">= 0.12"
}

Also, the Terraform documentation on IBM Cloud covers the migration steps and also the version control information here

0
Gas On

Looks like there is no automated migration, but the process is described in details here: Migrating Terraform version in Schematics workspace.

In short:

The upgrade requires the following steps to support the latest Terraform version in the Schematics workspace.

  1. Upgrade the Terraform configuration files to use the newer syntax and semantics.
  2. Migrate the Terraform state file to be compatible with the newer version.

Schematics does not support built in upgrade of the Terraform version. therefore, you must do the following:

  1. Prepare the upgraded version of Terraform configuration files and Terraform state file, in your local machine.
  2. Create a new Schematics workspace with the new Terraform configuration files and Terraform state file.
  3. Delete the older workspace (without destroying the resources).