All skills
Skillintermediate
/plan-apply - Terraform Plan and Apply
Run Terraform plan, review changes, and apply infrastructure updates.
Claude Code Knowledge Pack7/10/2026
Overview
/plan-apply - Terraform Plan and Apply
Run Terraform plan, review changes, and apply infrastructure updates.
Steps
- Verify the Terraform working directory and state backend configuration
- Run
terraform initto initialize providers and modules - Select or verify the target workspace (dev, staging, production)
- Run
terraform plan -out=tfplanto generate an execution plan - Parse the plan output to summarize changes: resources to add, change, destroy
- Highlight destructive changes (destroy or replace) that need special attention
- Check for potential issues: security group changes, IAM policy modifications
- Show estimated cost impact using infracost if available
- Ask for user confirmation before applying, especially for destructive changes
- Run
terraform apply tfplanto execute the approved plan - Verify the apply completed successfully and note any errors
- Save the plan output and apply results for audit purposes
Rules
- Always run plan before apply; never apply without reviewing changes
- Require explicit confirmation for any resource destruction
- Double-confirm when applying to production workspaces
- Use plan files (-out flag) to ensure the applied changes match the reviewed plan
- Never auto-approve applies in production environments
- Check for state lock before running plan or apply
- Log all plan and apply operations with timestamps for audit trails