> For the complete documentation index, see [llms.txt](https://docs.infraglide.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infraglide.com/deployments-and-execution-history/execution-actions.md).

# Plan, Deploy & Destroy Actions

## Plan, Deploy & Destroy Actions

### From the Pipeline Designer you can run three Terraform actions against a saved pipeline version: **Preview** (`plan`), **Deploy** (`apply`), and **Destroy** (`destroy`). ![alt text](/files/oV8GEA6ZhJ1kUqPJJboF)

### Prerequisites

Before any action succeeds:

* Pipeline is **saved** with components.
* A **credential** is attached in the toolbar.
* You have permission (`edit` for plan/apply, `manage` for destroy on My Pipelines).
* Org cloud provider policy allows the pipeline’s provider.
* No other deployment is active on this pipeline or lineage (otherwise **409**).
* Feature flag for pipeline deploy is enabled for your tenant. ![alt text](/files/kFtHHFvAPCsaTpJ3rZAT)

***

### Preview (Plan)

1. Click **Preview**.
2. InfraGlide creates a deployment record (`dryRun` style), generates `main.tf.json`, and executes `tfAction: "plan"`.
3. The API returns **202** immediately; work continues in the background.
4. Watch the console overlay / Executions logs.
5. Success ends in status **`planned`** with a parsed `planSummary` when available.

### Preview never creates cloud resources. ![alt text](/files/zV4Y7pqh94JsFh5syoP6)

### Deploy (Apply)

1. Click **Deploy**.
2. Confirm in the **Deploy Pipeline** dialog → **Start Deployment**.\
   ![alt text](/files/7j3wvpTydQYlErbBc9zN)
3. InfraGlide generates Terraform, then executes `tfAction: "apply"`.
4. HTTP **202** — poll status and stream logs.
5. Terminal statuses: **`success`**, **`partial_success`**, or **`failed`**. ![alt text](/files/SdmseTqboAyC9c6m8ODR)

Notes:

* Incomplete configuration may prompt **“Deployment may fail. Deploy anyway?”**
* Compliance gates can block apply with **422** when policies require it.
* **partial\_success** means some resources were created before an error — InfraGlide does **not** auto-rollback. Fix and redeploy; use Destroy only when you intend teardown.

***

### Destroy

1. Click **Destroy**.
2. Read the warning: resources created by this pipeline version will be destroyed.
3. Type the confirmation phrase **`destroy`**. ![alt text](/files/4fI84v6GLjrAN7xVNYD6)
4. Click **Destroy Infrastructure**.
5. Request body includes `{ tfAction: "destroy", confirmPhrase: "destroy" }`.
6. Success ends in **`destroyed`**. ![alt text](/files/l0fddHDEzzfcVQDnOIW0)

Scheduled destroy jobs (Pipeline Scheduler) trigger teardown operations automatically based on your configured cron schedule.

***

### Asynchronous Execution Lifecycle

When you initiate an action (`Preview`, `Deploy`, or `Destroy`), InfraGlide processes the execution asynchronously in the background:

1. A deployment execution record is initialized for the pipeline version.
2. The background worker acquires execution locks, connects to your target cloud provider, and begins streaming live log output.
3. The UI status badges update automatically from **Running** to **Success** or **Failed** upon completion.

***

### Force Replace

For advanced resource recovery, InfraGlide supports **Force Replace** on individual nodes. Marking a node for force replacement instructs Terraform during the next deployment run to taint and re-create that specific resource without destroying the rest of your pipeline infrastructure.

![alt text](/files/HW3OhlGGIbpadgM8OQKd)

***

### See also

* [Execution History & Live Logs](/deployments-and-execution-history/execution-history.md)
* [Resource Tracking & Status Badges](/deployments-and-execution-history/resource-tracking.md)
* [State File & Backend Management](/terraform-iac-engine/state-management.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.infraglide.com/deployments-and-execution-history/execution-actions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
