{"record":{"id":"ca72ba754c0fe959","repo":"hashicorp/terraform","slug":"import-blocks-are-not-supported-in-this-version-of","errorCode":null,"errorMessage":"Import blocks are not supported in this version of Terraform Enterprise. Please remove any import blocks from your config or upgrade Terraform Enterprise.","messagePattern":"Import blocks are not supported in this version of Terraform Enterprise\\. Please remove any import blocks from your config or upgrade Terraform Enterprise\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cloud/backend_plan.go","lineNumber":348,"sourceCode":"\t}\n\n\treturn r, nil\n}\n\n// AssertImportCompatible errors if the user is attempting to use configuration-\n// driven import and the version of the agent or API is too low to support it.\nfunc (b *Cloud) AssertImportCompatible(config *configs.Config) error {\n\t// Check TFC_RUN_ID is populated, indicating we are running in a remote TFC\n\t// execution environment.\n\tif len(config.Module.Import) > 0 && os.Getenv(\"TFC_RUN_ID\") != \"\" {\n\t\t// First, check the remote API version is high enough.\n\t\tcurrentAPIVersion, err := version.NewVersion(b.client.RemoteAPIVersion())\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error parsing remote API version. To proceed, please remove any import blocks from your config. Please report the following error to the Terraform team: %s\", err)\n\t\t}\n\t\tdesiredAPIVersion, _ := version.NewVersion(\"2.6\")\n\t\tif currentAPIVersion.LessThan(desiredAPIVersion) {\n\t\t\treturn fmt.Errorf(\"Import blocks are not supported in this version of Terraform Enterprise. Please remove any import blocks from your config or upgrade Terraform Enterprise.\")\n\t\t}\n\n\t\t// Second, check the agent version is high enough.\n\t\tagentEnv, isSet := os.LookupEnv(\"TFC_AGENT_VERSION\")\n\t\tif !isSet {\n\t\t\treturn fmt.Errorf(\"Error reading HCP Terraform Agent version. To proceed, please remove any import blocks from your config. Please report the following error to the Terraform team: TFC_AGENT_VERSION not present.\")\n\t\t}\n\t\tcurrentAgentVersion, err := version.NewVersion(agentEnv)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error parsing HCP Terraform Agent version. To proceed, please remove any import blocks from your config. Please report the following error to the Terraform team: %s\", err)\n\t\t}\n\t\tdesiredAgentVersion, _ := version.NewVersion(\"1.10\")\n\t\tif currentAgentVersion.LessThan(desiredAgentVersion) {\n\t\t\treturn fmt.Errorf(\"Import blocks are not supported in this version of the HCP Terraform Agent. You are using agent version %s, but this feature requires version %s. Please remove any import blocks from your config or upgrade your agent.\", currentAgentVersion, desiredAgentVersion)\n\t\t}\n\t}\n\treturn nil\n}","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/hashicorp/terraform/blob/c9def3e214014c1188faabfc4a5bde5095139765/internal/cloud/backend_plan.go#L330-L366","documentation":"Raised by AssertImportCompatible when configuration-driven import is used in a remote TFC run but the remote API version is older than 2.6 (the minimum that supports import blocks). It tells the user the backend cannot honour import blocks until upgraded.","triggerScenarios":"config has import blocks, TFC_RUN_ID is set, the API version parses but currentAPIVersion.LessThan(desiredAPIVersion) where desired is \"2.6\".","commonSituations":"Running an older Terraform Enterprise on-prem install (pre-2.6) while configuration uses import {} blocks; or a stale/under-provisioned HCP Terraform backend.","solutions":["Upgrade Terraform Enterprise to version 2.6 or later.","Remove import {} blocks from the config and import resources imperatively via 'terraform import' instead.","Run locally (do not set TFC_RUN_ID / use local execution mode) if you cannot upgrade the backend."],"exampleFix":"// before (config using import blocks, run against TFE < 2.6)\nimport {\n  to = aws_instance.web\n  id = \"i-abc\"\n}\n// after: imperative import against old TFE\nterraform import aws_instance.web i-abc","handlingStrategy":"validation","validationCode":"// Require API >= 2.6 before submitting configs with import blocks.\nconst minImportAPI = \"2.6\"\nif hasImportBlocks(cfg) && semverLT(apiVersion, minImportAPI) {\n    return fmt.Errorf(\"API %s < %s; upgrade TFE or remove import blocks\", apiVersion, minImportAPI)\n}","typeGuard":"func supportsImportBlocks(apiVer string) bool {\n    cur, e1 := version.NewVersion(apiVer)\n    min, _ := version.NewVersion(\"2.6\")\n    return e1 == nil && !cur.LessThan(min)\n}","tryCatchPattern":null,"preventionTips":["Upgrade TFE before adopting import blocks.","Maintain an imperative-import workflow for legacy backends.","Document the min TFE version in the config's README."],"tags":["terraform","import-blocks","tfe-version","cloud-backend","upgrade-required"],"analyzedSha":"c9def3e214014c1188faabfc4a5bde5095139765","analyzedAt":"2026-08-07T15:39:49.278Z","schemaVersion":2},"datasetVersion":"2026-08-07T20:17:04.800Z"}