Skip to content

Commit 6bbcd84

Browse files
drewmullensebasslash
authored andcommitted
add note and extra example
1 parent 7ad39d0 commit 6bbcd84

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

website/docs/r/workspace_settings.markdown

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ description: |-
77

88
# tfe_workspace_settings
99

10-
Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `overwrites` argument.
10+
~> **NOTE:** Manages or reads execution mode and agent pool settings for a workspace. This also interacts with the organization's default values for several settings, which can be managed with [tfe_organization_default_settings](organization_default_settings.html). If other resources need to identify whether a setting is a default or an explicit value set for the workspace, you can refer to the read-only `overwrites` argument.
11+
12+
~> **NOTE:** This resource manages values that can alternatively be managed by the `tfe_workspace` resource. You should not attempt to manage the same property on both resources which could cause a permanent drift. Example properties available on both resources: `description`, `tags`, `auto_apply`, etc.
1113

1214
## Example Usage
1315

@@ -96,6 +98,34 @@ output "workspace-explicit-local-execution" {
9698
}
9799
```
98100

101+
This resource can be used to self manage a workspace created from `terraform init` and a cloud block:
102+
103+
```hcl
104+
terraform {
105+
cloud {
106+
organization = "foo"
107+
workspaces {
108+
name = "self-managed"
109+
}
110+
}
111+
}
112+
113+
# workspace is created in CI during `init`
114+
data "tfe_workspace" "self" {
115+
name = split("/", var.TFC_WORKSPACE_SLUG)[1]
116+
organization = split("/", var.TFC_WORKSPACE_SLUG)[0]
117+
}
118+
119+
# settings and notification for workspace are applied
120+
resource "tfe_workspace_settings" "self" {
121+
workspace_id = data.tfe_workspace.self.id
122+
assessments_enabled = true
123+
tags = {
124+
prod = "true"
125+
}
126+
}
127+
```
128+
99129
## Argument Reference
100130

101131
The following arguments are supported:

0 commit comments

Comments
 (0)