Skip to content

Commit f094806

Browse files
committed
Update documentation and changelog
This commit updates the documentation and changelog for the Global Run Tasks feature.
1 parent 190e54e commit f094806

5 files changed

+100
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ FEATURES:
44
* `r/tfe_team`: Add attribute `manage_agent_pools` to `organization_access` on `tfe_team` by @emlanctot [#1358](https://github.com/hashicorp/terraform-provider-tfe/pull/1358)
55
* `r/tfe_workspace`: Add an `auto_destroy_activity_duration` attribute for automatic scheduling of auto-destroy runs based off of workspace activity, by @notchairmk [#1377](https://github.com/hashicorp/terraform-provider-tfe/pull/1377)
66
* `d/tfe_workspace`: Add an `auto_destroy_activity_duration`, by @notchairmk [#1377](https://github.com/hashicorp/terraform-provider-tfe/pull/1377)
7+
* `d/tfe_organization_run_task_global_settings`: Add a datasource to retrieve the global settings of Run tasks, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330)
8+
* `r/tfe_organization_run_task_global_settings`: Add a resource to manage the global settings of Run tasks, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330)
9+
10+
DEPRECATIONS and BREAKING CHANGES:
11+
* `r/_workspace_run_task`: The `stage` attribute has been deprecated in favor of the `stages` attribute, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330)
12+
* `d/_workspace_run_task`: The `stage` attribute has been deprecated in favor of the `stages` attribute, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330)
713

814
## v0.56.0
915

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
layout: "tfe"
3+
page_title: "Terraform Enterprise: tfe_organization_run_task_global_settings"
4+
description: |-
5+
Get information on a Run task's global settings.
6+
---
7+
8+
# Data Source: tfe_organization_run_task_global_settings
9+
10+
[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization.
11+
12+
The tfe_organization_run_task_global_settings resource creates, updates and destroys the [global settings](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#global-run-tasks) for an [Organization Run task](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). Your organization must have the `global-run-task` [entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#feature-entitlements) to use global run tasks.
13+
14+
## Example Usage
15+
16+
```hcl
17+
data "tfe_organization_run_task_global_settings" "example" {
18+
task_id = "task-abc123"
19+
}
20+
```
21+
22+
## Argument Reference
23+
24+
The following arguments are supported:
25+
26+
* `task_id` - (Required) The id of the Run task with the global settings.
27+
28+
## Attributes Reference
29+
30+
In addition to all arguments above, the following attributes are exported:
31+
32+
* `enabled` - Whether the run task will be applied globally.
33+
* `enforcement_level` - The enforcement level of the global task. Valid values are `advisory` and `mandatory`.
34+
* `stages` - The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`.

website/docs/d/workspace_run_task.html.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ In addition to all arguments above, the following attributes are exported:
3333

3434
* `enforcement_level` - The enforcement level of the task.
3535
* `id` - The ID of the Workspace Run task.
36-
* `stage` - Which stage the task will run in.
36+
* `stage` - **Deprecated** Use `stages` instead.
37+
* `stages` - Which stages the task will run in.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: "tfe"
3+
page_title: "Terraform Enterprise: tfe_organization_run_task_global_settings"
4+
description: |-
5+
Manages Run tasks global settings.
6+
---
7+
8+
# tfe_organization_run_task_global_settings
9+
10+
[Run tasks](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks) allow HCP Terraform to interact with external systems at specific points in the HCP Terraform run lifecycle. Run tasks are reusable configurations that you can attach to any workspace in an organization.
11+
12+
The tfe_organization_run_task_global_settings resource creates, updates and destroys the [global settings](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#global-run-tasks) for an [Organization Run task](https://developer.hashicorp.com/terraform/cloud-docs/workspaces/settings/run-tasks#creating-a-run-task). Your organization must have the `global-run-task` [entitlement](https://developer.hashicorp.com/terraform/cloud-docs/api-docs#feature-entitlements) to use global run tasks.
13+
14+
## Example Usage
15+
16+
Basic usage:
17+
18+
```hcl
19+
resource "tfe_organization_run_task_global_settings" "example" {
20+
task_id = tfe_organization_run_task.example.id
21+
enabled = true
22+
enforcement_level = "advisory"
23+
stages = ["pre_plan", "post_plan"]
24+
}
25+
26+
resource "tfe_organization_run_task" "example" {
27+
organization = "org-name"
28+
url = "https://external.service.com"
29+
name = "task-name"
30+
enabled = true
31+
description = "An example task"
32+
}
33+
```
34+
35+
## Argument Reference
36+
37+
The following arguments are supported:
38+
39+
* `enabled` - (Optional) Whether the run task will be applied globally.
40+
* `enforcement_level` - (Required) The enforcement level of the global task. Valid values are `advisory` and `mandatory`.
41+
* `stages` - (Required) The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`.
42+
* `task_id` - (Required) The id of the Run task which will have the global settings applied.
43+
44+
## Attributes Reference
45+
46+
* `id` - The ID of the global settings.
47+
48+
## Import
49+
50+
Run task global settings can be imported; use `<ORGANIZATION NAME>/<TASK NAME>` as the
51+
import ID. For example:
52+
53+
```shell
54+
terraform import tfe_organization_run_task_global_settings.test my-org-name/task-name
55+
```

website/docs/r/workspace_run_task.html.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ resource "tfe_workspace_run_task" "example" {
2020
workspace_id = resource.tfe_workspace.example.id
2121
task_id = resource.tfe_organization_run_task.example.id
2222
enforcement_level = "advisory"
23+
stages = ["pre_plan"]
2324
}
2425
```
2526

@@ -30,7 +31,8 @@ The following arguments are supported:
3031
* `enforcement_level` - (Required) The enforcement level of the task. Valid values are `advisory` and `mandatory`.
3132
* `task_id` - (Required) The id of the Run task to associate to the Workspace.
3233
* `workspace_id` - (Required) The id of the workspace to associate the Run task to.
33-
* `stage` - (Optional) The stage to run the task in. Valid values are `pre_plan`, `post_plan`, and `pre_apply`.
34+
* `stage` - **Deprecated** Use `stages` instead.
35+
* `stages` - (Optional) The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`.
3436

3537
## Attributes Reference
3638

0 commit comments

Comments
 (0)