Use Terraform import blocks with a generate configuration approach to import existing cloud resources and produce the corresponding resource configuration
Add import blocks to a Terraform configuration file specifying the to address of the resource block and the id string that uniquely identifies the existing cloud resource
Run terraform plan with the -generate-config-out flag pointing to an output file to have Terraform generate the initial resource configuration based on the imported resource's current state
Review the generated configuration file for accuracy, removing read-only attributes that Terraform manages internally and adjusting computed fields that should not appear in the desired-state config
Run terraform plan again without the generate flag to confirm the import produces no planned changes, indicating the generated configuration matches the live resource state
Commit the import blocks and resource configuration to version control, noting that import blocks are idempotent and safe to leave in the configuration after the initial import
Known gotchas
Generated configuration from -generate-config-out often includes attributes that are computed by the provider and should not be set in configuration; leaving them in causes a plan-time error on the next run when the provider marks those attributes as conflicts or deprecated
Import blocks require the resource address to match an existing or new resource block in the configuration; the block does not create the resource block automatically unless -generate-config-out is used, so a missing block causes an error
Some provider resources do not support import; attempting to import them produces a provider-specific error that looks like an ID format error — always check the provider documentation for import support before writing import blocks
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp