Plan Jobs
How Tendril executes PLAN jobs — terraform plan, structured output, and Infracost.
Plan Jobs
PLAN jobs run terraform plan to preview infrastructure changes without applying them.
Execution Flow
Assume cloud credentials
Provider-specific: STS AssumeRole (AWS), WIF exchange (GCP), or federated identity (Azure). See Cloud Credentials.
Generate Terraform variables
The vine's config snapshot is transformed into terraform.tfvars by the provisioner. Each vine component maps to specific Terraform variables.
terraform init
Initializes with the Supabase S3 backend:
bucket = "vine-terraform-state"
key = "{vineyard}/{project}/{stage}/{region}/terraform.tfstate"terraform plan
terraform plan -out=plan.tfplanGenerates a binary plan file describing what will change.
terraform show
terraform show -json plan.tfplanConverts the binary plan to structured JSON output for UI display.
Infracost analysis (optional)
If INFRACOST_API_KEY is configured:
infracost breakdown --path plan.json --format jsonParses per-resource cost estimates. See Cost Estimation.
Upload plan artifact
The binary plan.tfplan file is uploaded to Supabase Storage (plan-artifacts bucket) for later use by DEPLOY jobs.
Report results
Job status → SUCCESS with execution metadata:
- Resource change counts (add / change / destroy)
- Cost breakdown (if Infracost ran)
- Plan artifact reference
What the User Sees
After the plan completes, the Plan tab in the vine detail page shows:
- Resource groups with create/update/delete actions
- Per-resource costs
- Total estimated monthly cost
- An "Apply" button to proceed