spacelift-io / terraform-provider-spacelift

Terraform provider to interact with Spacelift
MIT License
74 stars 28 forks source link

`spacelift_stack`: Terragrunt block without `terraform_version` and `terragrunt_version` fails with error #524

Closed lorengordon closed 5 months ago

lorengordon commented 6 months ago

Creating a spacelift_stack for a terragrunt config, and it fails with this error:

│ Error: could not create stack: stack has 2 errors: terraform: invalid Terraform version constraints: improper constraint: , terragrunt: invalid Terragrunt version constraints: improper constraint: 
│ 
│   with spacelift_stack.this,
│   on main.tf line 2, in resource "spacelift_stack" "this":
│    2: resource "spacelift_stack" "this" {

The docs say that terraform_version and terragrunt_version are optional, so I haven't specified them:

  terragrunt {
    use_smart_sanitization = true
    use_run_all            = true
  }

The plan marked the values as known after apply, which seemed fine to me. Was just expecting it to use the latest versions, which is what the docs implied would happen. From the plan:

      + terragrunt {
          + terraform_version      = (known after apply)
          + terragrunt_version     = (known after apply)
          + use_run_all            = true
          + use_smart_sanitization = true
        }
truszkowski commented 5 months ago

Thanks for reporting this @lorengordon It works now!

Screenshot 2024-04-11 at 11 26 14

lorengordon commented 5 months ago

@truszkowski was the fix a change to the API, or do I need a specific minimum version of the provider?