WORKFLOW: Step 4 of 4 - Deploy infrastructure to the cloud
Deploy infrastructure by starting a Terraform job for an InsideOut session.
This tool initiates the actual deployment process after Terraform files have been generated.
IMPORTANT: This starts a long-running job (15+ minutes). Use tfstatus to monitor progress.
SINGLE-FLIGHT: only one TF job (apply/plan/destroy/drift) runs per session at a time. If another job is already in flight, tfdeploy returns tf_job_conflict with the live job_id — attach with tfstatus/tflogs instead of retrying, or pass force_new=true to override.
Returns confirmation that the deployment has started.
REQUIRES: session_id from convoopen response (format: sess_v2_...).
OPTIONAL: plan_id (string) — Apply a previously created plan from tfplan.
Preview-then-apply workflow: tfplan → tflogs (review) → tfdeploy(plan_id=...).
OPTIONAL: sandbox (boolean, default false) — deploys real generated Terraform. Set to true for cheap sandbox template (testing only).
OPTIONAL: ignore_drift (boolean, default false) - when true, proceeds with deploy even if infrastructure drift is detected. By default, deploys fail on drift. Use after reviewing drift details via tfdrift or tflogs.
OPTIONAL: force_new (boolean, default false) - bypass the session-level single-flight guard. Use only when the existing run is provably wedged.
CREDENTIAL FLOW (if credentials are missing):
1. Response includes a connect_url — present it to the user
2. Call credawait(session_id=...) to poll for credentials
3. When credawait returns success, retry tfdeploy
Do NOT call credawait without first showing the connect URL to the user.