Skip to content

Fix: Add Terraform resource name validation - #10

Open
Ryan-825 wants to merge 1 commit into
123a-bcd:mainfrom
Ryan-825:fix/terraform-name-validation
Open

Fix: Add Terraform resource name validation#10
Ryan-825 wants to merge 1 commit into
123a-bcd:mainfrom
Ryan-825:fix/terraform-name-validation

Conversation

@Ryan-825

Copy link
Copy Markdown

Summary

This PR adds explicit validation for Terraform resource names before import, dry-run, and generated script output. Invalid names (especially hyphenated ones) are rejected with actionable error messages instead of invoking Terraform with unsafe addresses.

Changes

  • Added �alidate_terraform_name() function to check resource names
  • Integrated validation into import_resource(), import_batch() (dry-run), and generate_import_script()
  • Added comprehensive test suite with 12 tests
  • Generated diagnostic build logs

Testing

  • Ran python3 -m unittest tests.test_terraform_import -v - All 12 tests passed
  • Generated diagnostic logs with python3 build.py

Checklist

  • Relevant modules build locally
  • Tests pass locally
  • Diagnostic build log is committed

- Add validate_terraform_name() function to reject hyphenated names

- Integrate validation into import_resource, import_batch, and generate_import_script

- Add comprehensive test suite with 12 tests covering valid/invalid names

- Generate diagnostic build logs for the fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant