This project is an implementation of the Terraform/OpenTofu Provider Network Mirror Protocol which provides online caching of Providers and Modules. Instead of running terraform providers mirror
, you can connect to the proxy server which will serve the correct responses back to the terraform
/tofu
client.
The src folder contains code that converts JSON data from the online registry into the expected Mirror server JSON responses. Provider file caching is handled by a separate NGINX instance.
For configuring Provider installation using the proxy mirror, follow the instructions to configure your code:
provider_installation {
network_mirror {
url = "https://mirror.example.com/v1/providers/"
}
}
The mirror also handles requests for module information, but does not cache the upstream data files due to how the protocol works.
module "example" {
source = "mirror.example.com/path/to/module"
...
}