Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ The run operation specifies the Terraform execution mode. You can reference the
| `refresh_only` | The run should update Terraform state, but not make changes to resources. |
| `destroy` | The run should destroy all objects, regardless of configuration changes. |
| `empty_apply` | The run should perform an apply with no changes to resources. This is most commonly used to [upgrade terraform state versions](/terraform/cloud-docs/workspaces/state#upgrading-state). |
| `action_only` | The run is a `refresh_only` run that contains at least one [action invocation](/terraform/plugin/framework/actions). It updates state but does not create, change, or destroy resources. |

### Run Sources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,23 @@ Click a run to go to its details page. The details page contains the following i
- A timeline of events related to the run.
- The output from both the `terraform plan` and `terraform apply` commands, if applicable. This output defaults to visible if the command is currently running and hidden if the command has finished.

<!-- BEGIN: TFC:only name:actions -->

### Action runs

@include 'beta.mdx'
HCP Terraform identifies runs that invoke actions on the run details page. Actions are preset operations built into providers that you can invoke to trigger automations outside of Terraform, such as Ansible playbooks and Lambda jobs. Refer to [Invoke an action](/terraform/language/invoke-actions) in the Terraform configuration language documentation for more information.

HCP Terraform indicates how many actions the run invoked and adds **action:** labels to the **Plan** operation output and **Invoked:** labels to the **Apply** operation output.

You can invoke actions either as part of a resource lifecycle configuration or manually target a specific action using the `-invoke` flag to a `terraform apply` or `terraform plan` command.

<Note>

A Standard tier subscription is required to use the `-invoke` flag to execute an action and to view details about action runs that were invoked from the command line using the `-invoke` flag. Refer to the [Terraform pricing page](https://www.hashicorp.com/en/pricing?tab=terraform) for more information.

If a run invokes an action that is triggered as part of a resource lifecycle, HCP Terraform identifies them on the run details page. HCP Terraform indicates how many actions the run invoked and adds **action:** labels to the **Plan** operation output and **Invoked:** labels to the **Apply** operation output.
</Note>

Actions are preset operations built into providers that you can invoke to trigger automations outside of Terraform, such as Ansible playbooks and Lambda jobs. Refer to [Invoke an action](/terraform/language/v1.14.x/invoke-actions) in the Terraform configuration language documentation for more information.

<!-- END: TFC:only name:actions -->

## Interacting with Runs

Expand Down
6 changes: 0 additions & 6 deletions content/terraform/v1.13.x/docs/cli/commands/apply.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ plan.

> **Hands On:** Try the [Apply Terraform Configuration](/terraform/tutorials/cli/apply?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial to learn how Terraform applies a configuration, how Terraform recovers from errors during apply, and common ways to use this command.

<Note>

Terraform `v1.14.x (beta)` adds the `-invoke` flag, which lets you trigger actions outside of Terraform CRUD operations. Refer to the [Invoke an action](/terraform/language/v1.14.x/invoke-actions) beta documentation for more information.

</Note>

## Usage

Usage: `terraform apply [options] [plan file]`
Expand Down
6 changes: 0 additions & 6 deletions content/terraform/v1.13.x/docs/cli/commands/plan.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ description: >-
The `terraform plan` command creates an execution plan, which lets you preview
the changes that Terraform plans to make to your infrastructure.

<Note>

Terraform `v1.14.x (beta)` adds the `-invoke` flag, which lets you trigger actions outside of Terraform CRUD operations. Refer to the [Invoke an action](/terraform/language/v1.14.x/invoke-actions) beta documentation for more information.

</Note>

## Introduction

By default, Terraform performs the following operations when it creates a plan:
Expand Down
6 changes: 0 additions & 6 deletions content/terraform/v1.13.x/docs/language/block/resource.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ description: >-

The `resource` block defines a piece of infrastructure and specifies the settings for Terraform to create it with. The arguments that an individual resource supports are determined by the provider. Refer to the provider documentation for more information about specific resource configuration.

<Note>

Terraform `v1.14.x (beta)` supports the `action_trigger` block, which you can add to resource configurations to trigger actions outside of Terraform CRUD operations. Refer to the [Invoke an action](/terraform/language/v1.14.x/invoke-actions) beta documentation for more information.

</Note>

## Configuration model

The `resource` block supports the following arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ Meta-arguments are a class of arguments built into the Terraform configuration l

The provider developer determines resource-specific arguments, but all resources support meta-arguments that let you manage resources' infrastructure lifecycle, including destruction behavior, preventing destruction, and establishing dependencies between resources. Terraform provides the following meta-arguments.

<Note>

Terraform `v1.14.x (beta)` adds the `action_trigger` meta-argument, which lets you trigger actions that extend Terraform CRUD operations. Refer to the [Invoke an action](/terraform/language/v1.14.x/invoke-actions) beta documentation for more information.

</Note>

## `depends_on`

The `depends_on` meta-argument instructs Terraform to complete all actions on the dependency object, including `read` operations, before performing actions on the object declaring the dependency. Use the `depends_on` argument to explicitly set the order in which Terraform creates resources. Refer to the [`depends_on` reference](/terraform/language/meta-arguments/depends_on) for details.
Expand Down
6 changes: 3 additions & 3 deletions content/terraform/v1.14.x/data/language-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@
"routes": [
{
"title": "Overview",
"path": "meta-arguments",
"alias": "actions"
"path": "meta-arguments"
},
{
"title": "count",
Expand All @@ -426,7 +425,8 @@
},
{
"title": "lifecycle",
"path": "meta-arguments/lifecycle"
"path": "meta-arguments/lifecycle",
"alias": "actions"
},
{
"title": "provider",
Expand Down
9 changes: 2 additions & 7 deletions content/terraform/v1.14.x/docs/language/invoke-actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ description: Learn how to invoke actions defined in Terraform configuration lang

Actions are preset operations built into providers that let Terraform perform day-two operations. Invoke actions to trigger automations outside of Terraform, such as Ansible playbooks and Lambda jobs. Actions do not affect resource state.

@include 'beta.mdx'

## Overview

Declare an `action` block in your Terraform configuration and apply your configuration or use the Terraform CLI to invoke the action. You can configure actions that aren't directly associated with a resource. These actions don't change the state of resources managed by Terraform.

## Requirements

Provider authors implement actions for them to be available. To check for actions available in your provider, refer to the provider documentation. Actions are available in the following providers on the Terraform Registry:
Provider develoeprs must implement actions for them to be available. Refer to the provider documentation for information about actions that may be available in your provider.

- [aws](https://registry.terraform.io/providers/hashicorp/aws/latest)
- [azurerm](https://registry.terraform.io/providers/hashicorp/azurerm/latest)

### HCP Terraform

To monitor actions in HCP Terraform, you must configure a connection to HCP Terraform in your Terraform configuration. Refer to [Connect to HCP Terraform](/terraform/cli/cloud/settings) for instructions.
Expand Down Expand Up @@ -128,4 +123,4 @@ Because the `event` argument includes `after_update`, Terraform also updates th

## View actions in HCP Terraform

If your workspace is connected to your HCP Terraform organization, you can monitor action runs in HCP Terraform. Refer to [Action runs](/terraform/cloud-docs/run/manage#action-runs) in the HCP Terraform documentation for more information.
If your workspace is connected to your HCP Terraform organization, you can monitor action runs in HCP Terraform. Refer to [Action runs](/terraform/cloud-docs/workspaces/run/manage#action-runs) in the HCP Terraform documentation for more information.
Loading