|
| 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 | +``` |
0 commit comments