diff --git a/spacemk/exporters/terraform.py b/spacemk/exporters/terraform.py index 6b380b9..c5b8ad3 100644 --- a/spacemk/exporters/terraform.py +++ b/spacemk/exporters/terraform.py @@ -1285,15 +1285,15 @@ def find_workspace_variable_with_invalid_name(data: dict, workspace_id: str, typ vcs_repository = None terraform_version = workspace.get("attributes.terraform-version") - if terraform_version == "latest": - # KLUDGE: Stick to the latest MPL-licensed Terraform version for now - terraform_version = "1.5.7" - - if semver.match(workspace.get("attributes.terraform-version"), ">=1.5.7"): + if terraform_version != "latest" and semver.match(terraform_version, ">=1.5.7"): terraform_workflow_tool = "CUSTOM" else: terraform_workflow_tool = "TERRAFORM_FOSS" + if terraform_version == "latest": + # KLUDGE: Stick to the latest MPL-licensed Terraform version for now + terraform_version = "1.5.7" + if "relationships.project.data.id" in workspace: space_id = workspace.get("relationships.project.data.id") else: