terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Allow mirroring providers from a mirror

Open Yanni8 opened this issue 3 months ago • 1 comments

Terraform Version

Terraform v1.9.8-dev
on darwin_amd64

Use Cases

Terraform allows you to configure network and file mirrors of registries. This is a great feature, but there are some commands which ignore this configuration by default. An example of this would be terraform providers lock or terraform providers mirror. It makes total sense to ignore the mirror configurations in this case since the original registry should be treated as the source of truth.

The problem now is that there are some specific use cases where you don't want to use the original registry but rather get the packages from the mirror. In that case, it would be great to have some sort of CLI parameter to force Terraform to get the packages from the configured mirrors. The terraform providers lock command already has this in some form with the -net-mirror=URL flag, but the terraform providers mirror command currently misses this possibility.

Attempted Solutions

There isn't much that can be done to resolve this problem directly. The only workaround I've found is to manually mirror it, but this is definitely not a good idea.

Proposal

It would be nice to have some sort of parameter to force Terraform to get all the packages from the configured mirrors instead of the original registry. This could be, for example, in the form of a flag -include-mirror or with a -net-mirror=URL flag, similar to how terraform providers lock handles it.

References

No response

Yanni8 avatar Nov 14 '24 08:11 Yanni8