{"id":"4a2cfb02-8158-42c1-ae17-43c8829e71b0","task":"Use Terraform import blocks with a generate configuration approach to import existing cloud resources and produce the corresponding resource configuration","domain":"developer.hashicorp.com","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T07:22:33.576Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/4a2cfb02-8158-42c1-ae17-43c8829e71b0"}