Hi,
I’m sure it’s something I am doing wrong as opposed to a bug, hence asking for help here as opposed to a Github issue.
In TF Cloud, when running a plan, I get the plan error:
Terraform v1.0.11
on linux_amd64
Configuring remote state backend...
Initializing Terraform configuration...
Setup failed: Failed terraform init (exit 1): <nil>
Output:
Initializing modules...
╷
│ Error: Error accessing remote module registry
│
│ Failed to retrieve available versions for module "website_region_0"
│ (product_main.tf:1) from app.terrafrom.io: Failed to request discovery
│ document: Get "https://app.terrafrom.io/.well-known/terraform.json": dial
│ tcp: lookup app.terrafrom.io on 127.0.0.53:53: no such host.
╵
╷
│ Error: Error accessing remote module registry
│
│ Failed to retrieve available versions for module "website_region_0"
│ (product_main.tf:1) from app.terrafrom.io: Failed to request discovery
│ document: Get "https://app.terrafrom.io/.well-known/terraform.json": dial
│ tcp: lookup app.terrafrom.io on 127.0.0.53:53: no such host.
From the line Failed to retrieve available versions for module "website_region_0"
, my initial thought was to publish the plan’s main.tf
into the registry, which didn’t work, and it’s like it referencing itself.
There are very few references to this and they refer to on-prem or TFE. I am pretty certain this is during the terraform init
stage. My backend is configured thus:
provider "azurerm" {
features {}
}
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=2.86.0"
}
}
backend "remote" {
hostname = "app.terraform.io"
organization = "myOrg"
workspaces {
name = "myWorkspaceName"
}
}
}
I’ve set up a variable group for accessing Azure, but as this is init
, it shouldn’t care. As this is running in TF Cloud, I believe I don’t have to pass any credentials for itself.
In the root of the repo, targeted by the workspace, I have main.tf:
module "website_region_0" {
source = "app.terrafrom.io/myOrg/website/model"
version = ">=0.0.1"
...
}
website
is a published module.
I don’t know if TF Cloud needs the azurerm
provider adding to my private registry or whether it downloads it on the fly (as terraform init
would do), but I have added it.
I’ve run out of ideas as to what I have done wrong, so if anyone has any pointers, I’d be grateful if you could share. This is using 1.0.11
.
T.I.A