env0 / terraform-provider-env0

Terraform Provider for env0

Home Page:https://env0.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

env0_template opentofu_version pattern match failure for RESOLVE_FROM_CODE

emoshaya opened this issue · comments

Describe the bug
When setting the opentofu version to resolve from code in the ui and trying to update the env0_template resource config to match remote config, it fails when the opentofu_version attribute is set to "RESOLVE_FROM_CODE" to match remote config.

To Reproduce
Steps to reproduce the behavior.

1- update the env0 template to use opentofu and resolve from code for version
2 - run plan which shows the drift
3- update config to match remote
4- pattern match failure for "RESOLVE_FROM_CODE"

resource "env0_template" "this" {
    id                    = "d0f1ac44-33fc-4555-9999-00000000"
    name                  = "terraform-workspace"
    opentofu_version      = "RESOLVE_FROM_CODE" -> null
    type                  = "opentofu" -> "terraform"
    # (13 unchanged attributes hidden)
}
│ Error: must match pattern ^(?:[0-9]\.[0-9]{1,2}\.[0-9]{1,2})|1\.6\.0-alpha$
│
│   with module.env0_template_project_environment.env0_template.this,
│   on modules/env0_template_project_environment/main.tf line 18, in resource "env0_template" "this":
│   18:   opentofu_version = "RESOLVE_FROM_CODE"

Expected behavior
"RESOLVE_FROM_CODE" should be a valid value for the opentofu_version attribute

Provider Version
1.17.1