GoogleCloudPlatform / terraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Apache License 2.0
12.47k stars 1.64k forks source link

Support for registeries other than registry.terraform.io #1840

Closed Nullreff closed 3 months ago

Nullreff commented 8 months ago

Right now the provider registry is hard coded as registry.terraform.io when looking up providers. For anyone using alternative registries such as registry.opentofu.org or self hosting their own registry, this causes terraformer to fail with an error similar to:

2024/01/29 01:39:14 aws importing default region
2024/01/29 01:39:14 open /home/nullreff/.terraform.d/plugins/linux_amd64: no such file or directory

which is rather hard to track down what's going wrong. Possible fixes I can thing of might be:

As for workarounds, the best way I've found is to symlink the expected provider directory to the one you're using. For example using registry.opentofu.org:

ln -s ~/.terraform.d/plugins/registry.opentofu.org/ ~/.terraform.d/plugins/registry.terraform.io

However I wouldn't recommend this if you're using a mix of registries as they'll now be installed into the same directory.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Nullreff commented 6 months ago

Still an issue

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 7 days with no activity.