A few months ago, we released a https://www.hashicorp.com/blog/terraform-cloud-variable-sets-beta-now-available of a brand-new way to consistently manage variables across workspaces in a Terraform Cloud organization. With that in mind, we are now happy to announce the general availability of variable sets for https://cloud.hashicorp.com/products/terraform and https://www.hashicorp.com/products/terraform. Variable sets allow Terraform Cloud users to reuse both Terraform-defined and environment variables in an efficient and centralized way. Organization owners can create variable sets, populate the associated variables, and assign them to specific workspaces or across the entire organization.

The code sample below shows an example of creating a new variable set and assigning a variable to that variable set: resource "tfe_variable_set""prod_infra"{ name = “prod infra” description = “variables for azure infrastructure” global = false organization = data.tfe_organization.azure_prod.name workspaces = [tfe_workspace.webapp_prod.id,...]} resource "tfe_variable""azure_subscription_id"{ name = “subscription_id” value = “xxxxxx-xxxx-xxxx-xxxx-xxxxxx” organization = data.tfe_organization.azure_prod.name category = "terraform" variable_set = tfe_variable_set.prod_infra.id} #get-started-with-variable-setsGet Started with Variable Sets

Related Articles