When attempting to update an existing stack that was created using the TERRAFORM_FOSS workflow tool, we realized that we needed features available only in Terraform v1.7.0+. We implemented a custom runner image and set the terraform_workflow_tool to CUSTOM. However, the subsequent plan and apply resulted in the following error:
Error: could not update stack: stack has 1 error: terraform: specifying version for custom tool workflow is not possible
Expected Behavior
When updating a Spacelift stack to use a custom runner image and setting terraform_workflow_tool to CUSTOM, the provider should allow the stack update without assuming a default Terraform version (1.5.7). Ideally, the provider should accept an empty string or null value for terraform_version to indicate no specific version requirement for the custom workflow tool, or when the terraform_workflow_tool is set to CUSTOM, the terraform_version input could be completely ignored.
This change is not reflected in the plan as the provider resets the default terraform version to 1.5.7 when no value (empty string or null) is provided to that input.
Attempting to apply the configuration above results in the following error:
Error: could not update stack: stack has 1 error: terraform: specifying version for custom tool workflow is not possible
│
│ with spacelift_stack.admin["spacelift-example-stack"],
│ on main.tf line 34, in resource "spacelift_stack" "example":
│ 34: resource "spacelift_stack" "example" {
This error occurs because Spacelift sets a default Terraform version of 1.5.7 when terraform_version is not explicitly specified. Setting terraform_version to an empty string or null is ignored by the provider, leading to the conflict with the custom workflow tool.
Steps to Reproduce:
Create a Spacelift stack with the TERRAFORM_FOSS workflow tool.
Modify the stack configuration to use a custom runner_image and set terraform_workflow_tool to CUSTOM.
Try to apply the updated configuration.
Possible Solutions:
Allow the terraform_version attribute to accept an empty string or null value when terraform_workflow_tool is set to CUSTOM, signifying no specific version requirement for the custom tool.
Ignore any previously set value of terraform_version when terraform_workflow_tool is set to CUSTOM.
Automatically set terraform_version to NULL when terraform_workflow_tool is set to CUSTOM.
Implement a mechanism to explicitly specify the Terraform version for custom workflow tools.
Additional Context:
A report on Slack showed that this was reproducible through the UI, although I was able to manually override the terraform_version/terraform_workflow_tool
Overview
When attempting to update an existing stack that was created using the
TERRAFORM_FOSS
workflow tool, we realized that we needed features available only in Terraform v1.7.0+. We implemented a custom runner image and set theterraform_workflow_tool
toCUSTOM
. However, the subsequent plan and apply resulted in the following error:Expected Behavior
When updating a Spacelift stack to use a custom runner image and setting
terraform_workflow_tool
toCUSTOM
, the provider should allow the stack update without assuming a default Terraform version (1.5.7). Ideally, the provider should accept an empty string or null value forterraform_version
to indicate no specific version requirement for the custom workflow tool, or when theterraform_workflow_tool
is set toCUSTOM
, theterraform_version
input could be completely ignored.Actual Behavior
Stack configuration:
This change is not reflected in the plan as the provider resets the default terraform version to
1.5.7
when no value (empty string or null) is provided to that input.Plan output:
Attempting to apply the configuration above results in the following error:
This error occurs because Spacelift sets a default Terraform version of 1.5.7 when
terraform_version
is not explicitly specified. Settingterraform_version
to an empty string or null is ignored by the provider, leading to the conflict with the custom workflow tool.Steps to Reproduce:
runner_image
and setterraform_workflow_tool
to CUSTOM.Possible Solutions:
terraform_version
attribute to accept an empty string or null value whenterraform_workflow_tool
is set toCUSTOM
, signifying no specific version requirement for the custom tool.terraform_version
whenterraform_workflow_tool
is set toCUSTOM
.terraform_version
to NULL whenterraform_workflow_tool
is set toCUSTOM
.Additional Context:
A report on Slack showed that this was reproducible through the UI, although I was able to manually override the terraform_version/terraform_workflow_tool