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

Terragrunt Validate-All fails #47

Open
bbros-dev opened this issue Oct 12, 2020 · 3 comments
Open

Terragrunt Validate-All fails #47

bbros-dev opened this issue Oct 12, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@bbros-dev
Copy link

bbros-dev commented Oct 12, 2020

Thank you for all the effort put into this tool and for making it open source.

We are new to terraform/terragrunt and find that terragrunt validate-all fails.

$ terragrunt --version
terragrunt version v0.25.1

Is this expected?
If so is there a workaround?

$ git clone https://github.com/gruntwork-io/terragrunt-infrastructure-live-example.git

<elided>
$ cd terragrunt-infrastructure-live-example
$ terragrunt validate-all                                                      [15/234]
Error: Error in function call                                                                                       
  on /home/<redacted>/src/terragrunt-infrastructure-live-example/terragrunt.hcl line 15, in locals
:                    
  15:   environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
                      
Call to function "find_in_parent_folders" failed: ParentFileNotFound: Could not find a
env.hcl in any of the parent folders of
/home/<redacted>/src/terragrunt-infrastructure-live-example/terragrunt.hcl. Cause: Traversed all
the way to the root..
                                                               
[terragrunt] [/home/<redacted>/src/terragrunt-infrastructure-live-example] 2020/10/12 20:16:59 Enc
ountered error while evaluating locals.                      
[terragrunt] 2020/10/12 20:16:59 Error processing module at '/home/<redacted>/src/terragrunt-infra
structure-live-example/terragrunt.hcl'. How this module was found: Terragrunt config file fou
nd in a subdirectory of /home/<redacted>/src/terragrunt-infrastructure-live-example. Underlying er
ror: /home/<redacted>/src/terragrunt-infrastructure-live-example/terragrunt.hcl:15,45-68: Error in
 function call; Call to function "find_in_parent_folders" failed: ParentFileNotFound: Could n
ot find a env.hcl in any of the parent folders of /home/<redacted>/src/terragrunt-infrastructure-l
ive-example/terragrunt.hcl. Cause: Traversed all the way to the root..

etc.
@yorinasub17
Copy link
Contributor

yorinasub17 commented Oct 13, 2020

Ahhhh nevermind what was originally here: I just realized this is an issue with the example here.

@yorinasub17 yorinasub17 added question bug Something isn't working and removed question labels Oct 13, 2020
@yorinasub17
Copy link
Contributor

Ah ok the issue here is that you are running validate-all from the root of the project. This is actually not a supported mode of operation for this example, given that the intention is for prod and non-prod to be two separate AWS accounts (meaning, you need to authenticate separately).

It should work if you use validate-all from the prod folder or non-prod folder.

@bbros-dev
Copy link
Author

Okay, so it seems a documentation issue.

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

No branches or pull requests

2 participants