Skip to content

Commit

Permalink
Share Env attributes with cfgOptions.
Browse files Browse the repository at this point in the history
In #1823, functionality was added to check module dependencies during
destroy operations. This included creating a fresh `TerragruntOptions`
object [1] which, by default, has an empty map for the `Env` attribute [2].
This means we're losing all environment variables when checking for
dependencies.

[1] https://github.com/gruntwork-io/terragrunt/pull/1823/files#diff-2ce1e65bb8a23011007dae779c8bacbc45d28560b1bc4e7dc1079f52fd22cf14R504
[2] https://github.com/gruntwork-io/terragrunt/blob/7788a525ab61641211e3f8a127ed53b450e96bc8/options/options.go#L256
  • Loading branch information
jlepere-everlaw committed Sep 12, 2022
1 parent 7788a52 commit 86785a3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions configstack/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ func FindWhereWorkingDirIsIncluded(terragruntOptions *options.TerragruntOptions,
terragruntOptions.Logger.Debugf("Failed to build terragrunt options from %s %v", dir, err)
return nil
}
cfgOptions.Env = terragruntOptions.Env
cfgOptions.LogLevel = terragruntOptions.LogLevel
if terragruntOptions.TerraformCommand == "destroy" {
var hook = NewForceLogLevelHook(logrus.DebugLevel)
Expand Down

0 comments on commit 86785a3

Please sign in to comment.