layout | page_title | sidebar_current | description |
---|---|---|---|
tfe |
Terraform Enterprise: tfe_workspace |
docs-datasource-tfe-workspace-x |
Get information on a workspace. |
Use this data source to get information about a workspace.
~> NOTE: Using global_remote_state
or remote_state_consumer_ids
requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202104-1.
data "tfe_workspace" "test" {
name = "my-workspace-name"
organization = "my-org-name"
}
The following arguments are supported:
name
- (Required) Name of the workspace.organization
- (Required) Name of the organization.
In addition to all arguments above, the following attributes are exported:
id
- The workspace ID.allow_destroy_plan
- Indicates whether destroy plans can be queued on the workspace.auto_apply
- Indicates whether to automatically apply changes when a Terraform plan is successful.assessments_enabled
- Indicates whether health assessments such as drift detection are enabled for the workspace.file_triggers_enabled
- Indicates whether runs are triggered based on the changed files in a VCS push (iftrue
) or always triggered on every push (iffalse
).global_remote_state
- (Optional) Whether the workspace should allow all workspaces in the organization to access its state data during runs. If false, then only specifically approved workspaces can access its state (determined by theremote_state_consumer_ids
argument).remote_state_consumer_ids
- (Optional) A set of workspace IDs that will be set as the remote state consumers for the given workspace. Cannot be used ifglobal_remote_state
is set totrue
.operations
- Indicates whether the workspace is using remote execution mode. Set tofalse
to switch execution mode to local.true
by default.policy_check_failures
- The number of policy check failures from the latest run.queue_all_runs
- Indicates whether the workspace will automatically perform runs in response to webhooks immediately after its creation. Iffalse
, an initial run must be manually queued to enable future automatic runs.resource_count
- The number of resources managed by the workspace.run_failures
- The number of run failures on the workspace.runs_count
- The number of runs on the workspace.speculative_enabled
- Indicates whether this workspace allows speculative plans.ssh_key_id
- The ID of an SSH key assigned to the workspace.structured_run_output_enabled
- Indicates whether runs in this workspace use the enhanced apply UI.tag_names
- The names of tags added to this workspace.terraform_version
- The version (or version constraint) of Terraform used for this workspace.trigger_prefixes
- List of trigger prefixes that describe the paths Terraform Cloud monitors for changes, in addition to the working directory. Trigger prefixes are always appended to the root directory of the repository. Terraform Cloud or Terraform Enterprise will start a run when files are changed in any directory path matching the provided set of prefixes.trigger_patterns
- List of glob patterns that describe the files Terraform Cloud monitors for changes. Trigger patterns are always appended to the root directory of the repository. Only available for Terraform Cloud.vcs_repo
- Settings for the workspace's VCS repository.working_directory
- A relative path that Terraform will execute within.
The vcs_repo
block contains:
identifier
- A reference to your VCS repository in the format<organization>/<repository>
where<organization>
and<repository>
refer to the organization and repository in your VCS provider.branch
- The repository branch that Terraform will execute from.ingress_submodules
- Indicates whether submodules should be fetched when cloning the VCS repository.oauth_token_id
- OAuth token ID of the configured VCS connection.tags_regex
- A regular expression used to trigger a Workspace run for matching Git tags.