Skip to content

Commit 730c856

Browse files
committed
Deprecate execution_mode and agent_pool_id on tfe_workspace
1 parent dd50c7c commit 730c856

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

internal/provider/resource_tfe_workspace.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ func resourceTFEWorkspace() *schema.Resource {
8383
Optional: true,
8484
Computed: true,
8585
ConflictsWith: []string{"operations"},
86+
Deprecated: "Use resource tfe_workspace_settings to modify the workspace execution settings. This attribute will be removed in a future release of the provider.",
8687
},
8788

8889
"allow_destroy_plan": {
@@ -108,6 +109,7 @@ func resourceTFEWorkspace() *schema.Resource {
108109
Optional: true,
109110
Computed: true,
110111
ConflictsWith: []string{"operations"},
112+
Deprecated: "Use resource tfe_workspace_settings to modify the workspace execution settings. This attribute will be removed in a future release of the provider.",
111113
ValidateFunc: validation.StringInSlice(
112114
[]string{
113115
"agent",
@@ -146,7 +148,7 @@ func resourceTFEWorkspace() *schema.Resource {
146148
Type: schema.TypeBool,
147149
Optional: true,
148150
Computed: true,
149-
Deprecated: "Use execution_mode instead.",
151+
Deprecated: "Use tfe_workspace_settings to modify the workspace execution settings. This attribute will be removed in a future release of the provider.",
150152
ConflictsWith: []string{"execution_mode", "agent_pool_id"},
151153
},
152154

website/docs/r/workspace.html.markdown

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,48 @@ resource "tfe_workspace" "test" {
2828
}
2929
```
3030

31-
With `execution_mode` of `agent`:
31+
Usage with vcs_repo:
3232

3333
```hcl
3434
resource "tfe_organization" "test-organization" {
3535
name = "my-org-name"
3636
3737
}
3838
39-
resource "tfe_agent_pool" "test-agent-pool" {
40-
name = "my-agent-pool-name"
41-
organization = tfe_organization.test-organization.name
39+
resource "tfe_oauth_client" "test" {
40+
organization = tfe_organization.test-organization
41+
api_url = "https://api.github.com"
42+
http_url = "https://github.com"
43+
oauth_token = "oauth_token_id"
44+
service_provider = "github"
4245
}
4346
44-
resource "tfe_workspace" "test" {
45-
name = "my-workspace-name"
46-
organization = tfe_organization.test-organization.name
47-
agent_pool_id = tfe_agent_pool.test-agent-pool.id
48-
execution_mode = "agent"
47+
resource "tfe_workspace" "parent" {
48+
name = "parent-ws"
49+
organization = tfe_organization.test-organization
50+
queue_all_runs = false
51+
vcs_repo {
52+
branch = "main"
53+
identifier = "my-org-name/vcs-repository"
54+
oauth_token_id = tfe_oauth_client.test.oauth_token_id
55+
}
4956
}
50-
```
5157
5258
## Argument Reference
5359
5460
The following arguments are supported:
5561
5662
* `name` - (Required) Name of the workspace.
57-
* `agent_pool_id` - (Optional) The ID of an agent pool to assign to the workspace. Requires `execution_mode`
63+
* `agent_pool_id` - (Optional) **Deprecated** The ID of an agent pool to assign to the workspace. Requires `execution_mode`
5864
to be set to `agent`. This value _must not_ be provided if `execution_mode` is set to any other value or if `operations` is
5965
provided.
6066
* `allow_destroy_plan` - (Optional) Whether destroy plans can be queued on the workspace.
6167
* `assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`.
6268
* `auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`.
6369
* `auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`.
6470
* `description` - (Optional) A description for the workspace.
65-
* `execution_mode` - (Optional) Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode)
66-
to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`.
67-
Defaults your organization's default execution mode, or `remote` if no organization default is set. Using Terraform Enterprise, only `remote` and `local`
68-
execution modes are valid. When set to `local`, the workspace will be used
69-
for state storage only. This value _must not_ be provided if `operations`
70-
is provided.
71+
* `execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode)
72+
to use. Using Terraform Cloud, valid values are `remote`, `local` or `agent`. Using Terraform Enterprise, only `remote` and `local` execution modes are valid. When set to `local`, the workspace will be used for state storage only. This value _must not_ be provided if `operations` is provided.
7173
* `file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files
7274
in a VCS push. Defaults to `true`. If enabled, the working directory and
7375
trigger prefixes describe a set of paths which must contain changes for a
@@ -146,9 +148,6 @@ In addition to all arguments above, the following attributes are exported:
146148
* `id` - The workspace ID.
147149
* `resource_count` - The number of resources managed by the workspace.
148150
* `html_url` - The URL to the browsable HTML overview of the workspace.
149-
* `setting_overwrites` - Can be used to check whether a setting is currently inheriting its value from another resource.
150-
- `execution_mode` - Set to `true` if the execution mode of the workspace is being determined by the setting on the workspace itself. It will be `false` if the execution mode is inherited from another resource (e.g. the organization's default execution mode)
151-
- `agent_pool` - Set to `true` if the agent pool of the workspace is being determined by the setting on the workspace itself. It will be `false` if the agent pool is inherited from another resource (e.g. the organization's default agent pool)
152151
153152
## Import
154153

0 commit comments

Comments
 (0)