Multiple user tokens for different organizations in app.terraform.io

Until now, I am working with only one organization using app.terraform.io, say ‘A’ with user token set in ~/.terraformrc file. Right, I am using Mac. All my remote states are saved in org ‘A’ workspaces.

I have created another org ‘B’ now. Do I need to generate another user token if I want to work in org ‘B’. How can i switch my work to work against org ‘B’ and workspaces underneath them?

2 Likes

Hi @KalyanSista!

Terraform Cloud has a few different types of API token with different scopes. The one to put in your Terraform CLI configuration file is your user token, which has the same access level as your user account. If you use a single user account to access both organizations then you can also use a single API token for that user account.

Terraform Cloud also supports organization-specific tokens, but those are intended more for unattended operations via the API for management purposes, rather than for everyday Terraform CLI use.