From Local Terraform/OpenTofu to InfraDots
If you already run Terraform or OpenTofu locally (or in another CI/CD system), this page explains how to move to InfraDots with minimal change to your code.
What changes when you use InfraDots
| Aspect | Local / other backends | With InfraDots |
|---|---|---|
| Where runs execute | Your machine or CI runner | InfraDots or your worker pool |
| State | Local file or S3/other remote | Stored by InfraDots (remote, encrypted) |
| Variables | .tfvars, env vars, or vault | InfraDots UI/API (and optionally env vars) |
| Trigger | You run terraform apply | Push to VCS, manual run, or schedule |
Your .tf files stay the same; you mainly adjust backend and where you set variables.
Step 1: Create a workspace
- In InfraDots, create a workspace and give it a name (e.g. the same as your project or environment)
- Choose Terraform or OpenTofu and the version that matches your
required_version - Connect Version control and select the repo and branch that contain your Terraform/OpenTofu code
Step 2: Backend configuration
If you currently use a local or S3 (or other) backend, InfraDots runs use its own remote backend. You typically do not need to add a backend block to your repo for runs triggered in InfraDots — we inject the backend configuration.
If you sometimes run locally and want to use InfraDots state from your machine:
- Configure the remote backend (or the backend type InfraDots documents) with the correct hostname, organization, and workspace name
- Then run
terraform initortofu initonce; after that, plan/apply from your machine will use the same state as InfraDots
Check InfraDots docs or the API for the exact backend configuration (hostname, workspace ID, etc.) if you need to point the CLI at InfraDots state.
Step 3: Move variables and secrets to InfraDots
- List variables you use today: from
.tfvars, environment variables, or a vault - In the workspace (or organization), open Variables
- For each Terraform variable: Add variable with the same key as in your
variable "..."block, set the value, and enable Sensitive for secrets - For provider credentials (e.g. AWS, GCP): add them as Environment variables and mark them Sensitive
Do not commit .tfvars that contain secrets; keep secrets only in InfraDots (or a vault your workers can access).
Step 4: First run in InfraDots
- Trigger a Plan from the InfraDots workspace (or push to the connected branch if auto-run is on)
- Check the plan output — it should match what you’d see locally (no changes if state is already in sync)
- If the plan is correct, run Apply from InfraDots
- After that, state is in InfraDots; future runs (in InfraDots or from the CLI with the same backend) will use that state
Step 5: Optional — keep using the CLI
You can continue to use terraform or tofu on your laptop:
- Use the same repo and the same
.tffiles - For local plan/apply against InfraDots state, configure the backend as in Step 2 and run
initonce - Use InfraDots for production and team runs so you get history, approvals, and a single source of truth for state
Importing from Terraform Cloud
If you’re coming from Terraform Cloud, use InfraDots’ Import from Terraform Cloud to bring over workspaces, state, and (non-sensitive) variables in one go. Sensitive variables must be re-entered in InfraDots after import.
Summary checklist
- Create workspace and connect VCS (repo + branch)
- Set Terraform/OpenTofu version to match your code
- Add all variables and secrets in InfraDots (sensitive where needed)
- Run Plan, then Apply, in InfraDots
- (Optional) Configure remote backend for local CLI use
