Unable to use published module in terraform with token auth
Hey, I'm trying to use a module that I uploaded and published on a local terrareg instance, and what is happening is very strange to me. The terraform init
works with the source code below:
source = "terrareg.admin.url/__namespace/postgresql/gcp"
and this one below doesn't:
source = "terrareg.admin.url/xxxxxx.deploy1.xxxxxxxxxxxxx__namespace/postgresql/gcp"
What is also interesting to me is that I have this value ALLOW_UNAUTHENTICATED_ACCESS
set to 'False", which to my understanding should prevent unauthenticated access such as the one in the first example that works.
Below I have attached the full code causing the described issue:
module "postgresql" {
source = "terrareg.admin.url/xxxxxx.deploy1.xxxxxxxxxxxxx__namespace/postgresql/gcp"
version = "1.0.0"
gcp = "asdf"
k8s_master_ca_certificate = "asdf"
k8s_master_endpoint = "asdf"
network = "asdf"
resource_prefix = "asdf"
}
Here is the error I'm getting:
terraform init
Initializing the backend...
Initializing modules...
╷
│ Error: Error accessing remote module registry
│
│ on main.tf line 1:
│ 1: module "postgresql" {
│
│ Failed to retrieve available versions for module "postgresql" (main.tf:1) from terrareg.admin.url: error looking up
│ module versions: 401 UNAUTHORIZED
and env variables ANALYTICS_AUTH_KEYS: "xxxxxx.deploy1.xxxxxxxxxxxxx" ALLOW_UNAUTHENTICATED_ACCESS: "False" ALLOW_UNIDENTIFIED_DOWNLOADS: "False" EXAMPLE_ANALYTICS_TOKEN: "test_terrareg" INTERNAL_EXTRACTION_ANALYTICS_TOKEN: "" I hope I haven't misread the documentation and I'm indeed doing everything as intended.
Github reference: https://github.com/MatthewJohn/terrareg/issues/56