Skip to main content

atmos terraform workspace select

Use this command to select a Terraform workspace for an Atmos component in a stack.

atmos terraform workspace select --help

Usage

Execute the terraform workspace select command like this:

atmos terraform workspace select <component> -s <stack> [workspace-name] [options]

This command selects an existing Terraform workspace. If no workspace name is provided, Atmos calculates the appropriate workspace from the component's context variables and stack configuration.

tip

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

Examples

# Select workspace (auto-calculated from stack context)
atmos terraform workspace select vpc -s dev

# Select a specific workspace by name
atmos terraform workspace select vpc -s dev my-workspace

Arguments

component (required)

Atmos terraform component.

workspace-name (optional)

The name of the workspace to select. If not provided, Atmos calculates the workspace name from the stack context.

Flags

--stack (alias -s) (required)

Atmos stack.

--dry-run (optional)

Show what would be executed without actually running the command.

atmos terraform workspace select vpc -s dev --dry-run
--skip-init (optional)

Skip running terraform init before executing the command.

atmos terraform workspace select vpc -s dev --skip-init

Native Terraform Flags

The atmos terraform workspace select command supports native terraform workspace select flags. Pass them directly or use -- to separate Atmos flags from Terraform flags.

-or-create

Create the workspace if it doesn't already exist, then select it.

atmos terraform workspace select vpc -s dev -or-create my-workspace

See Also