InfraDots logo
Documentation

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

AspectLocal / other backendsWith InfraDots
Where runs executeYour machine or CI runnerInfraDots or your worker pool
StateLocal file or S3/other remoteStored by InfraDots (remote, encrypted)
Variables.tfvars, env vars, or vaultInfraDots UI/API (and optionally env vars)
TriggerYou run terraform applyPush 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

  1. In InfraDots, create a workspace and give it a name (e.g. the same as your project or environment)
  2. Choose Terraform or OpenTofu and the version that matches your required_version
  3. 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 init or tofu init once; 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

  1. List variables you use today: from .tfvars, environment variables, or a vault
  2. In the workspace (or organization), open Variables
  3. For each Terraform variable: Add variable with the same key as in your variable "..." block, set the value, and enable Sensitive for secrets
  4. 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

  1. Trigger a Plan from the InfraDots workspace (or push to the connected branch if auto-run is on)
  2. Check the plan output — it should match what you’d see locally (no changes if state is already in sync)
  3. If the plan is correct, run Apply from InfraDots
  4. 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 .tf files
  • For local plan/apply against InfraDots state, configure the backend as in Step 2 and run init once
  • 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