Apply Terraform changes to infrastructure
Applies Terraform plan to infrastructure with safety checks and confirmation prompts.
/plugin marketplace add JosiahSiegel/claude-plugin-marketplace/plugin install terraform-master@claude-plugin-marketplace[planfile] [-auto-approve] [-target=resource]Apply changes to reach the desired infrastructure state.
/tf-apply # Interactive apply
/tf-apply tfplan # Apply saved plan
/tf-apply -auto-approve # Non-interactive apply
/tf-apply -target=aws_instance.web # Target specific resource
# Verify initialization
terraform validate
# Review plan first
terraform plan
# Interactive (prompts for confirmation)
terraform apply
# Apply saved plan
terraform apply tfplan
# Non-interactive (CI/CD)
terraform apply -auto-approve
# With var file
terraform apply -var-file="prod.tfvars"
# Check outputs
terraform output
# Verify state
terraform state list
| Option | Description |
|---|---|
planfile | Apply saved plan file |
-auto-approve | Skip confirmation |
-var-file=FILE | Load variables |
-var='KEY=VALUE' | Set variable |
-target=RESOURCE | Apply to specific resource |
-parallelism=N | Limit parallel operations |
-lock-timeout=DURATION | State lock timeout |
-refresh=false | Skip state refresh |
# 1. Always plan first
terraform plan -out=tfplan
# 2. Review the plan carefully
# 3. Apply with timeout protection
terraform apply -lock-timeout=30m tfplan
# Don't auto-approve without review
terraform apply -auto-approve # Dangerous without prior plan review!
# Don't skip the plan step
terraform apply # Always plan first
# 1. Plan and save
terraform plan -out=tfplan
# 2. Apply saved plan
terraform apply tfplan
# Apply with timeout and no color
terraform apply \
-auto-approve \
-lock-timeout=30m \
-no-color \
tfplan
terraform apply -target=aws_instance.web -auto-approve
# Wait for lock or force unlock
terraform apply -lock-timeout=10m
# Or (dangerous): terraform force-unlock LOCK_ID
# Don't panic - state reflects actual changes
# Fix the issue and re-run
terraform apply