Skip to content

Commit 575ea3f

Browse files
authored
Merge pull request #1678 from hashicorp/fix-workspace-rmsourceurl
fix rm ForceNew workspace source values
2 parents ef48a2c + d35060a commit 575ea3f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ ENHANCEMENTS:
3636

3737
* `r/tfe_notification_configuration`: Add `token_wo` write-only attribute, by @uturunku1 ([#1664](https://github.com/hashicorp/terraform-provider-tfe/pull/1664))
3838

39+
* `r/tfe_workspace`: Do not force recreation of workspace if users do not provide `source_name` or `source_url`. [#1674](https://github.com/hashicorp/terraform-provider-tfe/pull/1674)
40+
3941
## v.0.64.0
4042

4143
FEATURES:

internal/provider/resource_tfe_workspace.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,12 @@ func resourceTFEWorkspace() *schema.Resource {
206206
"source_name": {
207207
Type: schema.TypeString,
208208
Optional: true,
209-
ForceNew: true,
210209
RequiredWith: []string{"source_url"},
211210
},
212211

213212
"source_url": {
214213
Type: schema.TypeString,
215214
Optional: true,
216-
ForceNew: true,
217215
ValidateFunc: validation.IsURLWithHTTPorHTTPS,
218216
RequiredWith: []string{"source_name"},
219217
},

website/docs/r/workspace.html.markdown

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ The following arguments are supported:
9696
* `remote_state_consumer_ids` - (Optional) **Deprecated** The set of workspace IDs set as explicit remote state consumers for the given workspace. Use [tfe_workspace_settings](workspace_settings) instead.
9797
* `source_name` - (Optional) A friendly name for the application or client
9898
creating this workspace. If set, this will be displayed on the workspace as
99-
"Created via <SOURCE NAME>".
100-
Requires `source_url` to also be set.
99+
"Created via <SOURCE NAME>". This value cannot be updated after
100+
initial creation. Use `terraform apply -replace` to update this value. Requires `source_url` to also be set.
101101
* `source_url` - (Optional) A URL for the application or client creating this
102102
workspace. This can be the URL of a related resource in another app, or a
103103
link to documentation or other info about the client.
104-
Requires `source_name` to also be set.
104+
Requires `source_name` to also be set. This value cannot be updated after
105+
initial creation. Use `terraform apply -replace` to update this value.
105106
**Note:** The API does not (currently) allow this to be updated after a
106107
workspace has been created, so modifying this value will result in the
107108
workspace being replaced. To disable this, use an [ignore changes](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes) lifecycle meta-argument

0 commit comments

Comments
 (0)