gruntwork-io/terragrunt-infrastructure-live-example

Terragrunt Validate-All fails

bbros-dev opened this issue · 3 comments

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.

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

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.

Okay, so it seems a documentation issue.