How It Works
- Ctrlplane renders a workspace configuration from your template
- The workspace is created or updated via Terraform Cloud API
- Variables are synced to match your template
- A run is triggered with auto-apply
- Ctrlplane verifies the run reaches
appliedstatus - Job is marked successful when verification passes
Prerequisites
- Terraform Cloud or Terraform Enterprise account
- API token with workspace and run permissions
- VCS connection (optional, for Git-based workflows)
Configuration
Job Agent Setup
Create a job agent with typetfe:
Deployment Configuration
| Field | Required | Description |
|---|---|---|
organization | Yes | Terraform Cloud organization |
address | Yes | Terraform Cloud/Enterprise URL |
token | Yes | API token |
template | Yes | Go template for workspace configuration |
Workspace Template
The template defines the Terraform Cloud workspace:| Field | Type | Description |
|---|---|---|
name | string | Workspace name (required) |
description | string | Workspace description |
execution_mode | string | remote, local, or agent |
auto_apply | bool | Auto-apply after plan |
terraform_version | string | Terraform version to use |
working_directory | string | Subdirectory for Terraform files |
vcs_repo | object | VCS repository settings |
variables | array | Workspace variables |
VCS Repository Settings
Variable Configuration
Template Context
The template has access to all job context:| Variable | Description |
|---|---|
.job | Job details |
.version | Version being deployed |
.deployment | Deployment details |
.environment | Environment details |
.resource | Target resource |
.variables | Merged deployment variables |
Automatic Verification
When a run is created, Ctrlplane automatically starts a verification that monitors the run status: Success conditions:applied- Run completed successfullyplanned_and_finished- Plan-only run completedplanned_and_saved- Plan saved for later apply
canceled- Run was canceleddiscarded- Run was discardederrored- Run failed with error
Example: Multi-Environment Infrastructure
Example: Agent-Based Execution
For private infrastructure, use agent execution mode:Troubleshooting
Workspace creation fails
- Verify organization name is correct
- Check API token has workspace:write permission
- Ensure workspace name is valid (alphanumeric, hyphens, underscores)
VCS connection errors
- Verify OAuth token ID is correct
- Check repository exists and is accessible
- Ensure branch or tag exists
Run fails to start
- Check workspace has valid configuration
- Verify VCS connection is working
- Review workspace settings in Terraform Cloud UI
Variables not updating
- Verify variable keys match expected format
- Check for duplicate variable definitions
- Sensitive variables won’t show values in UI