gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
7.93k stars 965 forks source link

tfr protocol doesn't work for private terraform cloud registry unknown HTTP error #2153

Open davoodharun opened 2 years ago

davoodharun commented 2 years ago

I have tried to utilize the source parameter in the terraform configuration block to point to a module in a private registry in Terraform Cloud.

terraform {
  source = "tfr://app.terraform.io/[organization-name]/[module-name]/azurerm?version=1.0.2"

...
}

I am receiving the error

error recieving HTTP data

time=2022-06-21T12:53:25-04:00 level=error msg=Unable to determine underlying exit code, so Terragrunt will exit with error code 1

I have exported the TG_TF_REGISTRY_TOKEN environment variable. I've tried a User API token, Team Token, and Organization Token from Terraform cloud, none of which have worked.

Am I missing something, or is this scenario not supported yet?

Here is the url that is spit out by the cli: https://app.terraform.io/api/registry/v1/modules/[org-name]/api-apimendpoint/azurerm/1.0.2/download

When I access this in a browser without the /download I get a successful JSON response.

terragrunt version v0.38.0 Terraform v1.1.7

denis256 commented 2 years ago

Hi, I'm not sure how used module is structured, but was used // to reference submodule?

tfr://registry.terraform.io/api-apimendpoint//modules/azurerm?version=1.0.2
davoodharun commented 2 years ago

it is not using a submodule

The url I've set in the .hcl file is in the format tfr://app.terraform.io/[organization-name]/[module-name]/azurerm?version=1.0.2

from the docs tfr://REGISTRY_HOST/MODULE_SOURCE?version=VERSION

my registry host is app.terraform.io/[terraform-cloud-organization] and my module name is api-apimendpoint

isn't registry.terraform.io for public modules?

davoodharun commented 2 years ago

the full url is: tfr://app.terraform.io/exeloncorp/api-apimendpoint/azurerm?version=1.0.2

i've also tried tfr://registry.terraform.io/exeloncorp/api-apimendpoint/azurerm?version=1.0.2 and "tfr://app.terraform.io/api-apimendpoint/azurerm?version=1.0.2"

asmontas-i commented 1 year ago

Facing same problem. Maybe someone has any updates?

Cafeine42 commented 1 year ago

I didn't find how to use terraform versioning too. (version = ">= 1.23")

yuklia commented 1 year ago

same issue terragrunt version v0.38.12

zdunning13 commented 1 year ago

We ran into the error recieving HTTP data error due to port exhaustion from our outbound NAT when trying to create hundreds of resources at once. Our NAT was configured to only allow 64 connections to a specific IP/Port, which caused our issue.

afdecastro879 commented 9 months ago

I have experience this as well using an User Token. Strangely, once I sign in into terraform cloud from the browser, only then the terragrunt plan is successful. Using terragrunt version v0.48.4