Closed saterrrr closed 6 days ago
Created gitlab issue: https://gitlab.dockstudios.co.uk/pub/terrareg/-/issues/534 gitlab-issue-id:534
Hey @saterrrr ,
Which version of Terraform are you using? The only reason I ask is that, since ~1.x.x, I think Terraform should print the body of the error (as opposed to just 403).
With regards to the tokens, there's a key difference between analytics tokens and authentication tokens.
The analytics tokens, which is enforced using ALLOW_UNIDENTIFIED_DOWNLOADS
, is the token in the module source URL:
module "postgresql" {
# E.g. exampletoken here
source = "terrareg.admin.url/exampletoken__namespace/postgresql/gcp"
version = "1.0.0"
gcp = "asdf"
k8s_master_ca_certificate = "asdf"
k8s_master_endpoint = "asdf"
network = "asdf"
resource_prefix = "asdf"
}
For authentication, which is enforced using ALLOW_UNAUTHENTICATED_ACCESS
, is configured in the ~/.terraformrc
file, e.g.:
credentials "terrareg.admin.url" {
token = "authtokenhere"
}
This is also where the ANALYTICS_AUTH_KEYS
can be used, as well as using terraform login terrareg.admin.url
to authenticate via the Terraform IDP
I'll test out the use-cases you've suggested to see if I can reproduce them
Many thanks Matt
@saterrrr Any luck with this? :)
@saterrrr
I'm going to close for now - please re-open if you have further issues
Matt
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:
Here is the error I'm getting:
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.