You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(workspace): add auto destroy attribute to resource and data source (#1354)
* feat(workspace): add auto destroy attribute to resource and data source
This change adds `auto_destroy_at` to Workspace resource and data source schemas. The Workspaces API accepts three possible types of values for auto_destroy_at:
- a set value
- e.g. a payload with the shape `{ "data": { "attributes": { "name": "some-workspace", "auto-destroy-at": "2006-01-02T15:04:05Z" }}}`
- an ignored value
- e.g. a payload with the shape `{ "data": { "attributes": { "name": "some-workspace" }}}`
- and an unset value
- e.g. a payload with the shape `{ "data": { "attributes": { "name": "some-workspace", "auto-destroy-at": null }}}`
* standardize auto destroy error messages
* fix changelog
* add docs note for `auto_destroy_at` attribute
* update docs
* call out ignore_changes for workspace auto destroy docs
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
ENHANCEMENTS:
4
4
*`r/tfe_oauth_client`: Add Bitbucket Data Center support with the `bitbucket_data_center` option for `service_provider` by @zainq11[#1303](https://github.com/hashicorp/terraform-provider-tfe/pull/1304)
5
+
*`r/tfe_workspace`: Add an `auto_destroy_at` attribute for scheduling an auto-destroy run in the future, by @notchairmk[1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354)
6
+
*`d/tfe_workspace`: Add an `auto_destroy_at` attribute for reading a scheduled auto-destroy, by @notchairmk[1354](https://github.com/hashicorp/terraform-provider-tfe/pull/1354)
Copy file name to clipboardExpand all lines: website/docs/d/workspace.html.markdown
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ In addition to all arguments above, the following attributes are exported:
35
35
*`allow_destroy_plan` - Indicates whether destroy plans can be queued on the workspace.
36
36
*`auto_apply` - Indicates whether to automatically apply changes when a Terraform plan is successful.
37
37
*`auto_apply_run_trigger` - Whether the workspace will automatically apply changes for runs that were created by run triggers from another workspace.
38
+
*`auto_destroy_at` - Future date/time string at which point all resources in a workspace will be scheduled to be deleted.
38
39
*`assessments_enabled` - (Available only in HCP Terraform) Indicates whether health assessments such as drift detection are enabled for the workspace.
39
40
*`file_triggers_enabled` - Indicates whether runs are triggered based on the changed files in a VCS push (if `true`) or always triggered on every push (if `false`).
40
41
*`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 the `remote_state_consumer_ids` argument).
Copy file name to clipboardExpand all lines: website/docs/r/workspace.html.markdown
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,10 @@ The following arguments are supported:
68
68
*`assessments_enabled` - (Optional) Whether to regularly run health assessments such as drift detection on the workspace. Defaults to `false`.
69
69
*`auto_apply` - (Optional) Whether to automatically apply changes when a Terraform plan is successful. Defaults to `false`.
70
70
*`auto_apply_run_trigger` - (Optional) Whether to automatically apply changes for runs that were created by run triggers from another workspace. Defaults to `false`.
71
+
*`auto_destroy_at` - (Optional) A future date/time string at which point all resources in a workspace will be scheduled for deletion. Must be a string in RFC3339 format (e.g. "2100-01-01T00:00:00Z").
72
+
73
+
~> **NOTE:**`auto_destroy_at` is not intended for workspaces containing production resources or long-lived workspaces. Since this attribute is in-part managed by HCP Terraform, using `ignore_changes` for this attribute may be preferred.
74
+
71
75
*`description` - (Optional) A description for the workspace.
72
76
*`execution_mode` - (Optional) **Deprecated** Which [execution mode](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings#execution-mode) to use. Use [tfe_workspace_settings](workspace_settings) instead.
73
77
*`file_triggers_enabled` - (Optional) Whether to filter runs based on the changed files
0 commit comments