Repository navigation
fix(import): build import IDs in the provider's documented format - #414
Conversation
…se web_search - listed_id always present Signed-off-by: David Yunta <davidy@inditex.com>
Signed-off-by: David Yunta <davidy@inditex.com>
Signed-off-by: David Yunta <davidy@inditex.com>
Signed-off-by: David Yunta <davidy@inditex.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
❗ This Pull Request will not trigger a docs releaseA Pull Request with no |
🚀 Docs Release PreviewMerging this Pull Request will release the docs site as
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved import identities can reach execution, provider lookup can select the wrong documentation, and accepted target lists can exceed subprocess argument limits.
3 open issues
What changed in this PR
This PR improves Terraform import mapping by building provider-specific import IDs from listed cloud resource IDs and preserving the original IDs for retries.
Changes:
- Adds provider-documentation lookup instructions and carries
listed_idthrough import attempts. - Removes the unused import-mapping
statusfield and updates related tests and documentation. - Raises the plan target limit from 256 to 4096 across the service, contract, and API reference.
| File | Description |
|---|---|
services/iac/src/models.py |
Raises the plan target limit. |
docs/src/modules/main/pages/reference/api/iac.adoc |
Documents the increased target limit. |
docs/src/modules/main/pages/guides/import-infrastructure.adoc |
Explains import ID construction and retries. |
core/tests/domains/services/test_terraform_validation_service.py |
Adds listed IDs to validation fixtures. |
core/tests/domains/services/test_terraform_import_address_service.py |
Checks preservation of original listed IDs. |
core/tests/application/use_cases/test_terraform_import_handler.py |
Updates fixtures and report expectations. |
core/src/infrastructure/tools/tool_registry_static.py |
Removes the unused mapping status field. |
core/src/infrastructure/tools/iac_import.json |
Requires listed IDs and describes provider-specific import formats. |
core/src/infrastructure/templates/base_layouts/core/import_addresses.jinja |
Adds format lookup and retry-context instructions. |
core/src/domains/services/terraform_import_address_service.py |
Retains listed IDs in mapped attempts. |
core/src/domains/dto.py |
Adds listed_id without affecting equality. |
core/src/application/services/terraform_import_service.py |
Preserves listed IDs in import outcomes. |
contracts/openapi/iac.v1.yaml |
Aligns the contract with the increased target limit. |
Review effort: Balanced
Updated the import process for resource blocks, including provider resolution and import ID format retrieval. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
🚀 Docs Release PreviewMerging this Pull Request will release the docs site as
|
|
|







Summary
Makes the import round's address mapping more accurate.
import_addresses.jinja) no longer only fixes the casing of the listed cloud ID. For each resource type it callsweb_searchto find the import ID format in the provider docs (using the provider version from.terraform.lock.hcl/required_providers), then builds the ID from values in the listed ID, for example a bucket name,vpc-…,<cluster>/<service>or an OCID. On a retry it is given the previous import ID and the engine's error.listed_idon every attempt.iac_import.jsonnow requireslisted_idon each entry, and it is stored onTerraformImportAttempt(left out of equality) so a rejected import can be rebuilt from the original listed ID.statustool field from theimport_addressestool.iac.v1.yaml) andservices/iac/src/models.py.reference/api/iac.adoc(targets limit) andguides/import-infrastructure.adoc(how import IDs are built, and the example).Checklist
git commit -S)Additional context
Tests for the import address service, validation service and import handler are updated for the new
listed_idfield.