Workspace Commands
General commands to manage Workspaces.
tfx workspace list
List workspaces available for a given Organization.
Using the --all flag allows returning to all Organizations available to the provided API Token.
Additionally there are several filters available, these can be used independently or in combination.
Using the --search flag allows filtering by workspace name with a given string.
Using the --repository flag allows filtering by workspaces connected to a given repository Identifier (example: straubt1/tfe-workspace-seed).
Using the --run-status flag allows filtering by workspaces with a current run with a given status (full list of available run statuses can be found here).
Using the --project-id flags allows filtering by Project.
Basic Example
$ tfx workspace listUsing config file: /Users/tstraub/.tfx.hclList Workspaces for Organization: fireflyFound 6 Workspaces╭─────────────────────────────┬─────────────────────┬────────────────┬───────────────────────┬──────────────────────┬───────────────┬────────╮│ NAME │ ID │ RESOURCE COUNT │ CURRENT RUN CREATED │ STATUS │ REPOSITORY │ LOCKED │├─────────────────────────────┼─────────────────────┼────────────────┼───────────────────────┼──────────────────────┼───────────────┼────────┤│ tfx-test-workspace-01 │ ws-hLFv8c9bjgXC3mdK │ 5 │ Fri Oct 30 13:30 2020 │ planned_and_finished │ tstraub/demo1 │ false ││ tfx-test-workspace-02 │ ws-yN6DnhYxB39qqAre │ 0 │ │ │ │ false ││ tfx-test-workspace-03 │ ws-3NhtTDoX6pqZguuB │ 3 │ │ │ │ false ││ tfx-test-workspace-04 │ ws-uhDDVjE6Q1WxwU5C │ 7 │ │ │ │ false ││ tfx-test-workspace-05 │ ws-yra8oTuc16pgYedk │ 2 │ │ │ │ false ││ tfx-test-workspace-06 │ ws-qsLatjFsibCPAKWr │ 1 │ │ │ │ false │╰─────────────────────────────┴─────────────────────┴────────────────┴───────────────────────┴──────────────────────┴───────────────┴────────╯Search Example
$ tfx workspace list --search awsUsing config file: /Users/tstraub/.tfx.hclList Workspaces for Organization: fireflyFound 4 Workspaces╭───────────────────┬─────────────────────┬────────────────┬───────────────────────┬────────────────┬───────────────┬────────╮│ NAME │ ID │ RESOURCE COUNT │ CURRENT RUN CREATED │ STATUS │ REPOSITORY │ LOCKED │├───────────────────┼─────────────────────┼────────────────┼───────────────────────┼────────────────┼───────────────┼────────┤│ aws-dev-uswest-1 │ ws-XXn8hDRGA56Wyzxe │ 12 │ Fri Oct 30 13:39 2022 │ policy_checked │ tstraub/demo1 │ true ││ aws-prod-uswest-1 │ ws-Trm11JYZz9dj46wT │ 8 │ Fri Oct 30 13:30 2022 │ errored │ tstraub/demo2 │ true ││ aws-dev-uswest-1 │ ws-BUBSQysttH1FGLqr │ 4 │ Fri Oct 30 13:34 2022 │ policy_checked │ tstraub/demo1 │ true ││ aws-prod-uswest-2 │ ws-ZWNdqJLrWzHEeevS │ 15 │ Fri Oct 30 13:22 2022 │ errored │ tstraub/demo2 │ true │╰───────────────────┴─────────────────────┴────────────────┴───────────────────────┴────────────────┴───────────────┴────────╯List All Example
$ tfx workspace list --allUsing config file: /Users/tstraub/.tfx.hclList Workspaces for all available OrganizationsFound 141 Workspaces╭──────────────┬───────────────────────┬─────────────────────┬────────────────┬───────────────────────┬──────────────────────┬───────────────┬────────╮│ ORGANIZATION │ NAME │ ID │ RESOURCE COUNT │ CURRENT RUN CREATED │ STATUS │ REPOSITORY │ LOCKED │├──────────────┼───────────────────────┼─────────────────────┼────────────────┼───────────────────────┼──────────────────────┼───────────────┼────────┤│ firefly │ tfx-test-workspace-01 │ ws-hLFv8c9bjgXC3mdK │ 5 │ Fri Oct 30 13:30 2020 │ planned_and_finished │ tstraub/demo1 │ false ││ firefly │ tfx-test-workspace-02 │ ws-yN6DnhYxB39qqAre │ 0 │ │ │ │ false ││ firefly │ tfx-test-workspace-03 │ ws-3NhtTDoX6pqZguuB │ 3 │ │ │ │ false ││ firefly │ tfx-test-workspace-04 │ ws-uhDDVjE6Q1WxwU5C │ 7 │ │ │ │ false ││ firefly │ tfx-test-workspace-05 │ ws-yra8oTuc16pgYedk │ 2 │ │ │ │ false ││ firefly │ tfx-test-workspace-06 │ ws-qsLatjFsibCPAKWr │ 1 │ │ │ │ false │╰──────────────┴───────────────────────┴─────────────────────┴────────────────┴───────────────────────┴──────────────────────┴───────────────┴────────╯List Workspaces with a repository Example
$ tfx workspace list --repository straubt1/demoUsing config file: /Users/tstraub/.tfx.hclList Workspaces for Organization: fireflyFound 6 Workspaces╭───────────────────┬─────────────────────┬────────────────┬───────────────────────┬────────────────┬───────────────┬────────╮│ NAME │ ID │ RESOURCE COUNT │ CURRENT RUN CREATED │ STATUS │ REPOSITORY │ LOCKED │├───────────────────┼─────────────────────┼────────────────┼───────────────────────┼────────────────┼───────────────┼────────┤│ tf-dev-us-west-1 │ ws-XXn8hDRGA56Wyzxe │ 10 │ Fri Oct 30 13:39 2022 │ errored │ straubt1/demo │ true ││ tf-stg-us-west-1 │ ws-Trm11JYZz9dj46wT │ 8 │ Fri Oct 30 13:30 2022 │ policy_checked │ straubt1/demo │ true ││ tf-prd-us-west-1 │ ws-BUBSQysttH1FGLqr │ 15 │ Fri Oct 30 13:30 2022 │ policy_checked │ straubt1/demo │ true ││ tf-dev-us-west-2 │ ws-ZWNdqJLrWzHEeevS │ 6 │ Fri Oct 30 13:30 2022 │ policy_checked │ straubt1/demo │ true ││ tf-stg-us-west-2 │ ws-ZPgFWuQ79qFeX7MD │ 12 │ Fri Oct 30 13:30 2022 │ policy_checked │ straubt1/demo │ true ││ tf-prd-us-west-2 │ ws-axCg6rXwKByChA6f │ 20 │ Fri Oct 30 13:30 2022 │ policy_checked │ straubt1/demo │ true │╰───────────────────┴─────────────────────┴────────────────┴───────────────────────┴────────────────┴───────────────┴────────╯List Workspaces with a repository and a run status Example
$ tfx workspace list --repository straubt1/demo --run-status erroredUsing config file: /Users/tstraub/.tfx.hclList Workspaces for Organization: fireflyFound 1 Workspaces╭───────────────────┬─────────────────────┬────────────────┬───────────────────────┬────────────────┬───────────────┬────────╮│ NAME │ ID │ RESOURCE COUNT │ CURRENT RUN CREATED │ STATUS │ REPOSITORY │ LOCKED │├───────────────────┼─────────────────────┼────────────────┼───────────────────────┼────────────────┼───────────────┼────────┤│ tf-dev-us-west-1 │ ws-XXn8hDRGA56Wyzxe │ 10 │ Fri Oct 30 13:39 2022 │ errored │ straubt1/demo │ true │╰───────────────────┴─────────────────────┴────────────────┴───────────────────────┴────────────────┴───────────────┴────────╯tfx workspace show
Show details of a given Workspace, include Team Access and State sharing.
Example
$ tfx workspace show -n tfx-testUsing config file: /Users/tstraub/.tfx.hclShow Workspace: tfx-testID: ws-VxepewkunumUbR9VResource Count: 8Terraform Version: 1.0.0Execution Mode: remoteAuto Apply: falseWorking Directory:Locked: falseGlobal State Sharing: falseCurrent Run Id: run-tNGxao7zMos5YrY1Current Run Status: erroredCurrent Run Created: Sun Aug 21 16:40 2022Team Access: appteam-read ws-outputsRemote State Sharing: tfx-test-workspace-16 tfx-test-workspace-17