# Cloud integration configuration for multiple selectable workspaces

**URL:** <https://discuss.hashicorp.com/t/cloud-integration-configuration-for-multiple-selectable-workspaces/65836>\
**Category:** HCP Terraform\
**Created:** [April 14, 2024, 5:44am UTC](https://discuss.hashicorp.com/t/cloud-integration-configuration-for-multiple-selectable-workspaces/65836 "2024-04-14T05:44:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maheshbabu](https://avatars.discourse-cdn.com/v4/letter/m/dc4da7/32.png) [@maheshbabu](https://discuss.hashicorp.com/u/maheshbabu)\
**Post date:** [April 14, 2024, 5:44am UTC](https://discuss.hashicorp.com/t/cloud-integration-configuration-for-multiple-selectable-workspaces/65836/1 "2024-04-14T05:44:09Z")

</div>

Hello,

Can someone guide whats the definition i have to use in my backend.tf to switch between the terraform cloud workspaces.

Its working with 1 static workspace name (ex: Dev). I want this to be switched for other 2 environments for which i have created 2 TFC workspaces named Staging and Prod.

terraform {  
cloud {  
organization = “my-org”  
hostname = “[app.terraform.io](http://app.terraform.io)”  
workspaces {  
name = “Dev” #How to switch between staging and prod  
}  
}  
}  
I have tried below but not worked out…

1. using var. env (Looks like there is a limitation not to use variables inside the block)  
2.defined TF\_VAR\_workspace\_name Environment variable inside the Dev,staging and prod workspaces with values to each… I am trying to use this in AZUredevops yaml pipeline… Still no luck.

Can someone help here?
