Import a single resource
Add animport block naming the resource address and the id to import, then run plan with -generate-config-out to write a starting configuration:
imports.tf
generated.tf, move its content into the file it belongs in, delete the import block, and run apply.
Multiple
import blocks in one file generate the whole batch in a single generated.tf. Every id form the resource’s own import documentation accepts (see each resource’s page on the Terraform Registry) works in an import block too.Import an entire workspace
For a first adoption, generating oneimport block per existing resource by hand does not scale. The script below discovers every resource in a workspace through the same API the dashboard uses, and prints one import block per resource to stdout.
gen-imports.sh
generated.tf looks right, delete imports.tf (or the individual blocks that succeeded) so a later plan does not keep re-evaluating them.
Resources that need a manual pass
Config generation depends on the API returning enough information to reconstruct every attribute. A few attributes it cannot recover, verified against a live workspace:Write-only credentials
Write-only credentials
orq_model.api_key, and orq_bedrock_model.assume_role_arn / assume_role_external_id, are never returned by the API after creation. The generated resource is missing them and fails to plan (Missing Configuration for Required Attribute) until they are added by hand, sourced from wherever the original credential is kept.orq_workspace_model.sharing
orq_workspace_model.sharing
sharing is required but populated only from a server read, which -generate-config-out cannot turn into an attribute value for a required nested block. Import the resource on its own first, then copy its actual sharing configuration from terraform state show orq_workspace_model.<name> into the generated block.Evaluators and models the provider does not manage
Evaluators and models the provider does not manage
orq_evaluator manages only llm_eval and python_eval evaluators; other types (function_eval, ragas, json_schema, http_eval, typescript_eval, bedrock_eval) are refused. orq_model manages only custom models created as openai-like; a custom model on another provider (Azure, Vertex, a LiteLLM import) has no matching resource yet. The script above skips these automatically.A resource type that is temporarily unreachable
A resource type that is temporarily unreachable
The script skips a resource type outright rather than aborting the run if its listing endpoint errors, and reports it on stderr. Re-run it later, or import that type individually with a single
import block.Next steps
Supported resources
Every resource the provider manages, with links to the full reference.
Enterprise baseline
A pre-written locked-down setup to compare an imported workspace against.