Skip to content

Commit

Permalink
Update documentation and changelog
Browse files Browse the repository at this point in the history
This commit updates the documentation and changelog for the Global Run
Tasks feature.
  • Loading branch information
glennsarti committed Jun 5, 2024
1 parent 431ba41 commit 072749e
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ ENHANCEMENTS:
* `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)
* `r/tfe_registry_module`: Add `initial_version` support for Branch Based Modules by @aaabdelgany [#1363](https://github.com/hashicorp/terraform-provider-tfe/pull/1363)
* `r/tfe_oauth_client`: Add `agent_pool_id` as an optional argument to enable Private VCS support, by @roleesinhaHC [1255](https://github.com/hashicorp/terraform-provider-tfe/pull/1255)
* `d/tfe_organization_run_task_global_settings`: Added a datasource to retrieve the global settings of Run tasks, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330)
* `r/tfe_organization_run_task_global_settings`: Added a resource to manage the global settings of Run tasks, by @glennsarti [#1328](https://github.com/hashicorp/terraform-provider-tfe/pull/1330)

BUG FIXES:
* `r/tfe_registry_module`: Prevents constant diff after a successful apply when `tags` and `tests_enabled` is not set by @Uk1288 [#1357](https://github.com/hashicorp/terraform-provider-tfe/pull/1357)

DEPRECATIONS and BREAKING CHANGES:
* `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)
* `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)

## v0.55.0

FEATURES:
Expand Down
34 changes: 34 additions & 0 deletions website/docs/d/organization_run_task_global_settings.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
layout: "tfe"
page_title: "Terraform Enterprise: tfe_organization_run_task_global_settings"
description: |-
Get information on a Run task's global settings.
---

# Data Source: tfe_organization_run_task_global_settings

[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.

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.

## Example Usage

```hcl
data "tfe_organization_run_task_global_settings" "example" {
task_id = "task-abc123"
}
```

## Argument Reference

The following arguments are supported:

* `task_id` - (Required) The id of the Run task with the global settings.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

* `enabled` - Whether the run task will be applied globally.
* `enforcement_level` - The enforcement level of the global task. Valid values are `advisory` and `mandatory`.
* `stages` - The stages to run the task in. Valid values are one or more of `pre_plan`, `post_plan`, `pre_apply` and `post apply`.
3 changes: 2 additions & 1 deletion website/docs/d/workspace_run_task.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ In addition to all arguments above, the following attributes are exported:

* `enforcement_level` - The enforcement level of the task.
* `id` - The ID of the Workspace Run task.
* `stage` - Which stage the task will run in.
* `stage` - **Deprecated** Use `stages` instead.
* `stages` - Which stages the task will run in.
55 changes: 55 additions & 0 deletions website/docs/r/organization_run_task_global_settings.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
layout: "tfe"
page_title: "Terraform Enterprise: tfe_organization_run_task_global_settings"
description: |-
Manages Run tasks global settings.
---

# tfe_organization_run_task_global_settings

[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.

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.

## Example Usage

Basic usage:

```hcl
resource "tfe_organization_run_task_global_settings" "example" {
task_id = tfe_organization_run_task.example.id
enabled = true
enforcement_level = "advisory"
stages = ["pre_plan", "post_plan"]
}
resource "tfe_organization_run_task" "example" {
organization = "org-name"
url = "https://external.service.com"
name = "task-name"
enabled = true
description = "An example task"
}
```

## Argument Reference

The following arguments are supported:

* `enabled` - (Optional) Whether the run task will be applied globally.
* `enforcement_level` - (Required) The enforcement level of the global task. Valid values are `advisory` and `mandatory`.
* `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`.
* `task_id` - (Required) The id of the Run task which will have the global settings applied.

## Attributes Reference

* `id` - The ID of the global settings.

## Import

Run task global settings can be imported; use `<ORGANIZATION NAME>/<TASK NAME>` as the
import ID. For example:

```shell
terraform import tfe_organization_run_task_global_settings.test my-org-name/task-name
```
4 changes: 3 additions & 1 deletion website/docs/r/workspace_run_task.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ resource "tfe_workspace_run_task" "example" {
workspace_id = resource.tfe_workspace.example.id
task_id = resource.tfe_organization_run_task.example.id
enforcement_level = "advisory"
stages = ["pre_plan"]
}
```

Expand All @@ -30,7 +31,8 @@ The following arguments are supported:
* `enforcement_level` - (Required) The enforcement level of the task. Valid values are `advisory` and `mandatory`.
* `task_id` - (Required) The id of the Run task to associate to the Workspace.
* `workspace_id` - (Required) The id of the workspace to associate the Run task to.
* `stage` - (Optional) The stage to run the task in. Valid values are `pre_plan`, `post_plan`, and `pre_apply`.
* `stage` - **Deprecated** Use `stages` instead.
* `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`.

## Attributes Reference

Expand Down

0 comments on commit 072749e

Please sign in to comment.