Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scaffold not detecting URL correctly when referring to tfr #3677

Open
1 task
henryjarend opened this issue Dec 18, 2024 · 1 comment
Open
1 task

scaffold not detecting URL correctly when referring to tfr #3677

henryjarend opened this issue Dec 18, 2024 · 1 comment
Labels
bug Something isn't working preserved Preserved issues never go stale

Comments

@henryjarend
Copy link

Describe the bug

I'm running into some inconsistent behavior when I try and scaffold vs when I just create a plain terragrunt.hcl file
Trying to scaffold from the registry results in an error (detailed below) that seems to indicate that it's not able to clone the module however when I paste a plain terraform block in with the source pointed at the same tfr address it works without any issue

Steps To Reproduce

  • run terragrunt scaffold tfr:///terraform-aws-modules/eks/aws?version=20.31.4 in an empty directory
    • Note the 3 forward slashes as described in terragrunt docs
  • running terragrunt scaffold tfr://registry.opentofu.org/terraform-aws-modules/eks/aws?version=20.31.4 results in the same error

The code snippet below results in a good init but without doing any of the scaffolding for you

terraform {
    source = "tfr:///terraform-aws-modules/eks/aws?version=20.31.4"
}

Expected behavior

Ideally scaffold should work to take in a module source whether it's from the registry or from a git repository. It seems like either I'm doing something wrong, the docs don't call out that you can't use scaffold with a registry or there's a bug in the code that doesn't detect the registry address and handle it accordingly.

Nice to haves

  • Terminal output
$ terragrunt scaffold tfr://registry.opentofu.org/terraform-aws-modules/eks/aws?version=20.31.4
08:59:25.919 WARN   Failed to parse url tfr://registry.opentofu.org/terraform-aws-modules/eks/aws?version=20.31.4
08:59:25.919 WARN   Failed to parse module url tfr://registry.opentofu.org/terraform-aws-modules/eks/aws?version=20.31.4
git: 'remote-tfr' is not a git command. See 'git --help'.

The most similar command is
        remote-ftp
08:59:26.252 WARN   Failed to find last release tag for tfr://registry.opentofu.org/terraform-aws-modules/eks/aws?version=20.31.4
08:59:26.252 INFO   Scaffolding a new Terragrunt module tfr://registry.opentofu.org/terraform-aws-modules/eks/aws?version=20.31.4 to .
08:59:26.252 ERROR  error downloading 'tfr://registry.opentofu.org/terraform-aws-modules/eks/aws?version=20.31.4'
08:59:26.253 ERROR  Unable to determine underlying exit code, so Terragrunt will exit with error code 1

Versions

  • Terragrunt version: terragrunt version v0.69.10
  • OpenTofu/Terraform version: OpenTofu v1.8.7 on linux_amd64
  • Environment details (Ubuntu 20.04, Windows 10, etc.):
    • Ubuntu 22.04.5 LTS (running in WSL)
    • git version 2.34.1
    • kernel: 5.15.167.4-microsoft-standard-WSL2

Additional context

Since the docs state that you can pass a registry address in this feels like it should work however I've run into nothing but issues trying to scaffold it out

@henryjarend henryjarend added the bug Something isn't working label Dec 18, 2024
@yhakbar yhakbar added the preserved Preserved issues never go stale label Dec 20, 2024
@yhakbar
Copy link
Collaborator

yhakbar commented Dec 20, 2024

This is indeed a bug, and something we should look to address soon. We'll look to tackle this after the Gruntwork holiday break. Please feel free to tag us for updates if we don't get to it promptly in the new year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preserved Preserved issues never go stale
Projects
None yet
Development

No branches or pull requests

2 participants