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

Support terragrunt.hcl file like tfswitch #117

Open
Swahjak opened this issue Apr 13, 2022 · 16 comments
Open

Support terragrunt.hcl file like tfswitch #117

Swahjak opened this issue Apr 13, 2022 · 16 comments

Comments

@Swahjak
Copy link

Swahjak commented Apr 13, 2022

Hi. First of all, thanks for both tgswitch and tfswitch. Absolute life savers.

Would be awesome if you could support using the terragrunt.hcl file like tfswitch does.

@crablab
Copy link
Contributor

crablab commented Apr 25, 2022

++ Was kinda surprised that tfswitch supported this but tgswitch didn't!

@Swahjak
Copy link
Author

Swahjak commented Jun 7, 2022

@warrensbox given the open issues, wouldn't it make sense to just completely switch the current tgswitch package and replace it with the ftswitch code? (and obviously switch out 'tf / terraform' with 'tg / terragrunt'. The code seems pretty generic (I don't do Go so ignore my ignorance if this is not the case).

Is that something worth considering? And is it something you're still willing to commit to?

@Swahjak
Copy link
Author

Swahjak commented Jun 8, 2022

Ok, so that was a bit less generic than expected, but I think I've managed to port it: https://github.com/Swahjak/terragrunt-switcher.

Once again; I am by no means a Go developer so I'm just going with what was available. That is also the reason for me referring to Swahjak/terragrunt-switcher, not trying to hijack your product, just didn't know how to test / get it to work without changing these references. If this is something you're willing to use / look at it @warrensbox I would be more than happy to create a pull (and obviously change Swahjak/terragrunt-switcher back to warrensbox/terragrunt-switcher).

@warrensbox
Copy link
Owner

I am working on this. I will release feature this next Monday Jun 13, 2022 @Swahjak

@warrensbox
Copy link
Owner

I apologize for the delay. I am still running test cases for this release.

@Swahjak
Copy link
Author

Swahjak commented Jun 16, 2022

No worries! Glad you're willing to commit time to this.

@warrensbox warrensbox mentioned this issue Jun 23, 2022
@warrensbox
Copy link
Owner

@Swahjak I released this feature with 0.6.0
https://github.com/warrensbox/tgswitch/releases/tag/0.6.0
Can you help me test it?

@maxfriedrich
Copy link

Hi, I have a simple setup that results in a 404 page from GitHub pages being downloaded and stored in ~/.terragrunt.versions:

terragrunt.hcl:

terragrunt_version_constraint = "0.35.20"
$ rm -r ~/.terragrunt.versions && tgswitch
Terragrunt file found: /Users/max.friedrich/tgswitch-test/terragrunt.hcl
Reading required version from constraint: 0.35.20
Matched version: 0.35.20
2022/07/07 14:56:54 Creating directory for terragrunt: /Users/max.friedrich/.terragrunt.versions/
Downloading https://warrensbox.github.io/terragunt-versions-list/index.json/v0.35.20/terragrunt_darwin_amd64 to terragrunt_darwin_amd64
Downloading ...
9339 bytes downloaded.
Switched terragrunt to version "0.35.20"

$ head ~/.terragrunt.versions/terragrunt_0.35.20
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; img-src data:; connect-src 'self'">
    <title>Page not found &middot; GitHub Pages</title>
    <style type="text/css" media="screen">
      body {
        background-color: #f1f1f1;
        margin: 0;

If the specified version was already downloaded before with tgswitch "0.35.20" everything works as expected.

@shabbskagalwala
Copy link

+1 to this, installed tgswitch and running into the same error on a new install. Which then results in

→ [04:17:28]  ✗ terragrunt -v
/Users/shabbirkagalwala/bin/terragrunt: line 7: syntax error near unexpected token `newline'
/Users/shabbirkagalwala/bin/terragrunt: line 7: `<!DOCTYPE html>'

The version I installed was

→ [04:22:31]  ✗ tgswitch --version

Version: 0.6.0

@wouter-toppy
Copy link

@warrensbox behalf of @Swahjak i can say its working.

I also would like to suggest if you can provide this issue too : #89

you can close this

@wouter-toppy
Copy link

find out now, I have the same issue as @maxfriedrich

@wouter-toppy
Copy link

If the specified version was already downloaded before with tgswitch "0.35.20" everything works as expected

This is a temperary solution

@warrensbox
Copy link
Owner

I am traveling out of the country at the moment. I will take a look at this when I return home.

@antimack
Copy link

have the same issue, any chance this can have more attention?

@crablab
Copy link
Contributor

crablab commented Nov 2, 2022

I have created a separate issue for the 404 problem - I don't think it is related to this issue, which can probably be closed since the functionality has been released.

@kvendingoldo
Copy link

btw. you can also use tenv that support Terraform as well as OpenTofu (and Terragrunt :) ) in one tool. It allow you to simplify version management and can do much more, than tgswitch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants