from = "terraform://..." syntax on an input block solves this. ubx reads the Terraform state file directly from S3, GCS, or Azure Blob Storage, extracts the output value you specify, and makes it available as a regular resolved input. Terraform keeps managing what it manages. ubx starts managing what it manages. They share outputs through state, not through manual copy-paste.
What you’ll learn
- How
from = "terraform://..."reads outputs from existing Terraform state - The supported path syntax for S3, GCS, and Azure Blob backends
- How to migrate incrementally without disrupting existing Terraform-managed infra
Why this matters
Terraform state bridge is the canonical migration path for teams moving from Terraform to ubx. You don’t need to migrate everything at once — keep Terraform managing stable infra and use ubx for new work, consuming Terraform outputs via
from = "terraform://..." until you’re ready to migrate the rest.The source code
How it works
ubx parses and validates the from= path at compile time
The
terraform:// URI syntax is validated by the ubx parser — it checks that the backend type is one of s3, gcs, azblob, and that the #output-name fragment is present. Invalid paths produce a compile error, not a runtime failure.The state file is read at plan and apply time
When you run
ubx plan or ubx apply, ubx downloads the specified Terraform state file from the remote backend (using your current AWS/GCP/Azure credentials), parses the JSON, and extracts the named output value. The Terraform state file is never modified.What ubx generates
Common mistakes
Run it
What you learned
from = "terraform://..." reads a named output from an existing Terraform state fileSupported backends:
s3, gcs, azblob — the same backends Terraform usesThe Terraform state file is read-only — ubx never modifies it
Migrate incrementally: keep Terraform managing stable infra, use ubx for new work
Next steps
Migrate from Terraform
Full step-by-step Terraform migration guide
ubx vs Terraform
Why ubx, when to migrate, and what stays the same
Full runnable example: github.com/ubiquex/ubx-examples/17-input-from-terraform-state

