Problem
Workspaces are not created when ordering one of the following workflows (not flows): Create Workspace
, Create Workspace with Vars
, Provision Workspace
, and Provision Workspace with Vars
. In the logs, the following error is displayed:
Cannot read property "terraform_version" from undefined
Prerequisites
- Terraform ServiceNow Service Catalog Integration v2.1.0
Cause
Part of the v2.1.0 release included renaming the VCS repository variable in the code. Due to a lack of a global search feature, not all instances of this variable were updated. The four workflows mentioned above are using the old variable name and the code breaks trying to access an unknown variable. The error seen in the logs is a downstream error.
Solution
The following steps can be used for any/all of the workflows mentioned above.
Note: This solution requires a user who can read and edit the Terraform application in the Studio.
- Navigate to the
Studio
and selectTerraform
as your application in the dialog that appears. - Scroll down to the bottom of the left sidebar to Workflows > Create Workspace (or whatever workflow you wish you edit). This will open in a new window.
- Check out the workflow (to be able to make changes) by clicking the three-bar navigation icon in the top left of this window and then selecting
Check out
. - Double click the center step of the workflow (
Run Script: Create Workspace API
). - Around line 14, change
tf_var_vcs_repository
tovcs_repository
. - Click Update.
- Publish the workflow by clicking the three-bar navigation icon in the top left of this window and then selecting
Publish
.
This is a temporary workaround and has been fixed in a later release.