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.96k stars 967 forks source link

Unable to download terraform modules from Jfrog artifactory private registry using tfr or https #3403

Open nveeramn opened 2 weeks ago

nveeramn commented 2 weeks ago

Describe the bug

Terragrunt fails to download a Terraform module from a JFrog Artifactory private registry, resulting in an HTTP error. The error occurs when attempting to download the module using the tfr:// or https protocol

Steps To Reproduce

terraform {
  source = "tfr://<your_artifactory_domain>/artifactory/aws/mymod?version=1.0.0"
}
ERRO[0000] downloading source url tfr://<your_artifactory_domain>/artifactory/aws/mymod?version=1.0.0
1 error occurred:
* error downloading 'tfr://<your_artifactory_domain>/artifactory/aws/mymod?version=1.0.0': Error downloading module from https://<your_artifactory_domain>/artifactory/api/terraform/v1/modules/artifactory/aws/mymod/1.0.0/download: error receiving HTTP data

also tried using https but doesnt seem to like the credentials and throws 401 error

terraform {
  source = "https://<your_artifactory_domain>/artifactory/aws/mymod?version=1.0.0"
}

Seeing 401 error. Tried setting up TG_TF_REGISTRY_TOKEN but couldnt find any luck, also made sure that the same creds works with curl

Expected behavior

Terragrunt should successfully download the specified module from the Artifactory registry without encountering HTTP errors.