Skip to content

Change on tf_vars should also trigger a new template version #97

@michvllni

Description

@michvllni

Currently, a change in the tf_vars property does not trigger a recreation but a modification of the template.

As the tf_vars effectively change the content of the template, it should trigger a new version.

As an example, it would be possible to change the name of a parameter via tf_var.

A more drastic example to show what would be possible is to base the entire coder parameters on a tf_var:

template.tf

resource "coderd_template" "example" {
  name        = "example"
  description = "example"

  versions = [
    {
      directory = "./template"
      active    = true
      tf_vars = [{
        name = "parameters"
        value = jsonencode([
          "cpu",
          "memory"
        ])
      }]
    }
  ]
}

in the template:

variable "parameters" {
  type = string
}

locals {
  parameters = jsondecode(var.parameters)
}

data "coder_parameter" "parameters" {
  for_each = toset(local.parameters)
  name     = each.key
}

If I change the content of the parameters var via the coderd_template in this scenario, the whole template would change.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy