Skip to main content

atmos terraform workspace

Purpose

Use this command to calculate the terraform workspace for an Atmos component (from the context variables and stack config). It will run terraform init -reconfigure and then select the workspace by executing the terraform workspace select command.

atmos terraform workspace --help

Usage​

Execute the terraform workspace command like this:

atmos terraform workspace <component> -s <stack>

This command calculates the terraform workspace for an Atmos component (from the context variables and stack config), then runs terraform init -reconfigure, then selects the workspace by executing the terraform workspace select command.

If the workspace does not exist, the command creates it by executing the terraform workspace new command.

tip

Run atmos terraform workspace --help to see all the available options

Examples​

atmos terraform workspace top-level-component1 -s tenant1-ue2-dev
atmos terraform workspace infra/vpc -s tenant1-ue2-staging
atmos terraform workspace test/test-component -s tenant1-ue2-dev
atmos terraform workspace test/test-component-override-2 -s tenant2-ue2-prod
atmos terraform workspace test/test-component-override-3 -s tenant1-ue2-dev

Arguments​

ArgumentDescriptionRequired
componentAtmos componentyes

Flags​

FlagDescriptionAliasRequired
--stackAtmos stack-syes
--dry-runDry runno