Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Variable Sets #391

Closed
mbevc1 opened this issue Nov 11, 2021 · 12 comments
Closed

Supporting Variable Sets #391

mbevc1 opened this issue Nov 11, 2021 · 12 comments

Comments

@mbevc1
Copy link

mbevc1 commented Nov 11, 2021

Use-cases

New feature released: https://www.hashicorp.com/blog/terraform-cloud-variable-sets-beta-now-available

Attempted Solutions

/

Proposal

It seems it's already part of API: https://www.terraform.io/docs/cloud/api/variable-sets.html
I recognize it's still in beta, but it would be nice have a resource in TFE for configuring it.

@madtank
Copy link

madtank commented Dec 28, 2021

Thanks for opening this feature request. What I would need is ability to add variable sets to a workspace. Creating and updating the variable sets would be nice option too.

@elocke
Copy link

elocke commented Jan 14, 2022

Thanks for submitting this, variable sets solve a problem very elegantly for us but cannot be used easily without the provider supporting them.

@dkirrane
Copy link

Any ETA for this?

@madtank
Copy link

madtank commented Jan 28, 2022

Any ETA for this?

I was told April 2022 timeframe.

@rorychatterton
Copy link

rorychatterton commented Feb 12, 2022

A couple of items that would be useful for customers like myself when implementing this provider:

Seperate Set from Assignment objects

Can you please ensure that we have separate objects to handle the creation of the variable set, away from the assignment of that variable set. For example:

Not this:

resource "tfe_variable_set" "my_set" {
   tfe_workspaces = [...]
}

But rather this:

resource "tfe_variable_set" "my_set" {}
resource "tfe_variable_set_assignment" "my_set_assignment_ws_1" {
    variable_set = ""
    tfe_workspaces = ""
}

We would like this to be able to decouple the creation of global variable sets, from the assignment to workspaces. This particular pain point exists with the policy workspace, and it would be great if we could avoid it here!

Handle Complex Terraform Objects

The current terraform variable class doesn't handle complex objects. If you want to output a complex object into a terraform managed variable (such as a map of objects), you must convert that object into a string (we normally use json encode).

This limits the usefulness of the variable provider as you are not able to do type validation on the consuming workspace side.

I have raised an issue here for resolution in the context of standard variables. In essence, handle:

resource "tfe_variable_set" "my_set" {
   variable {
     key = "value1"
     value = { subkey1 = "...", subkey2 = "..."}
  }
}

@Satak
Copy link

Satak commented Feb 16, 2022

This would be very useful 🤞

@ryanisnan
Copy link

Plus one on this feature!

@morremeyer
Copy link

morremeyer commented Mar 15, 2022 via email

@mbevc1
Copy link
Author

mbevc1 commented Mar 30, 2022

Nice one, we have Variable Sets supports merged in and available with 0.30.0!

@mbevc1 mbevc1 closed this as completed Mar 30, 2022
@jacobtaunton
Copy link

I'm getting an error adding a workspace to a varset.

resource "tfe_variable_set" "this" {
name = "var.varset"
organization = var.organization
workspaces = tfe_workspace.this.id
}

on ../modules/workspaces/main.tf line 46, in resource "tfe_variable_set" "this":
│ 46: workspaces = tfe_workspace.this.id

│ An argument named "workspaces" is not expected here.

@morremeyer
Copy link

morremeyer commented Apr 1, 2022 via email

@madtank
Copy link

madtank commented Apr 1, 2022

It's wonkspace_ids, the docs are wrong here. The documentation bug is being fixed, there's already a PR for it.

That’s sort of funny :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants