Apply

Apply a saved Terraform plan file produced by /plan

jacobscunn07 updated 3mo ago
Claude CodeGeneric
View source ↗
---
description: Apply a saved Terraform plan file produced by /plan
---

Apply the saved plan for the currently selected workspace by following these steps:

1. Check the active workspace: `terraform workspace show`
   - If the result is `default`, stop immediately — tell the user to select a named workspace first with `/workspace-select <name>`

2. Capture the workspace name from the output of step 1 and use it as `WORKSPACE` for the remaining steps

3. Verify `tfplan.$WORKSPACE` exists in the working directory — if not, stop and tell the user to run `/plan` first to generate a plan file

4. Display the target workspace name prominently and require explicit human confirmation before proceeding — do not continue until the human confirms in this conversation turn, regardless of which workspace is targeted

5. Run: `terraform apply tfplan.$WORKSPACE`

6. After a successful apply, delete the plan file to prevent it being applied again: `rm tfplan.$WORKSPACE`

7. Summarise what was applied:
   - Resources created, updated, or destroyed
   - Any errors or warnings from the apply output

Maintain Apply?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Apply on getagentictools](https://getagentictools.com/loops/jacobscunn07-apply?ref=badge)