Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gruntwork-io/terragrunt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.36.9
Choose a base ref
...
head repository: gruntwork-io/terragrunt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.36.10
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on May 4, 2022

  1. Copy the full SHA
    bc20d4a View commit details
  2. fix bug where strict validation wasn't always respected (#2056)

    * fix bug where strict validation, check, and checkDepdendentModules flags weren't always respected if a source was added to the terragrunt.hcl file
    
    * add test to ensure strict validation is respected
    
    * cleanup terraform state for fail-unused-inputs tests
    
    * fix bug in input validation tests where they would fail when run in parallel due to conflicting git state
    raidancampbell authored May 4, 2022
    Copy the full SHA
    1929180 View commit details
Showing with 20 additions and 2 deletions.
  1. +2 −0 docs/_docs/04_reference/cli-options.md
  2. +3 −0 options/options.go
  3. +5 −0 test/fixture-validate-inputs/fail-unused-inputs/terragrunt.hcl
  4. +10 −2 test/integration_debug_test.go
2 changes: 2 additions & 0 deletions docs/_docs/04_reference/cli-options.md
Original file line number Diff line number Diff line change
@@ -458,6 +458,7 @@ prefix `--terragrunt-` (e.g., `--terragrunt-config`). The currently available op
- [terragrunt-ignore-dependency-errors](#terragrunt-ignore-dependency-errors)
- [terragrunt-iam-role](#terragrunt-iam-role)
- [terragrunt-iam-assume-role-duration](#terragrunt-iam-assume-role-duration)
- [terragrunt-iam-assume-role-session-name](#terragrunt-iam-assume-role-session-name)
- [terragrunt-exclude-dir](#terragrunt-exclude-dir)
- [terragrunt-include-dir](#terragrunt-include-dir)
- [terragrunt-strict-include](#terragrunt-strict-include)
@@ -467,6 +468,7 @@ prefix `--terragrunt-` (e.g., `--terragrunt-config`). The currently available op
- [terragrunt-include-external-dependencies](#terragrunt-include-external-dependencies)
- [terragrunt-parallelism](#terragrunt-parallelism)
- [terragrunt-debug](#terragrunt-debug)
- [terragrunt-log-level](#terragrunt-log-level)
- [terragrunt-check](#terragrunt-check)
- [terragrunt-hclfmt-file](#terragrunt-hclfmt-file)
- [terragrunt-override-attr](#terragrunt-override-attr)
3 changes: 3 additions & 0 deletions options/options.go
Original file line number Diff line number Diff line change
@@ -324,6 +324,7 @@ func (terragruntOptions *TerragruntOptions) Clone(terragruntConfigPath string) *
WorkingDir: workingDir,
Logger: util.CreateLogEntryWithWriter(terragruntOptions.ErrWriter, workingDir, terragruntOptions.LogLevel, terragruntOptions.Logger.Logger.Hooks),
LogLevel: terragruntOptions.LogLevel,
ValidateStrict: terragruntOptions.ValidateStrict,
Env: util.CloneStringMap(terragruntOptions.Env),
Source: terragruntOptions.Source,
SourceMap: terragruntOptions.SourceMap,
@@ -352,6 +353,8 @@ func (terragruntOptions *TerragruntOptions) Clone(terragruntConfigPath string) *
AwsProviderPatchOverrides: terragruntOptions.AwsProviderPatchOverrides,
HclFile: terragruntOptions.HclFile,
JSONOut: terragruntOptions.JSONOut,
Check: terragruntOptions.Check,
CheckDependentModules: terragruntOptions.CheckDependentModules,
}
}

Original file line number Diff line number Diff line change
@@ -2,3 +2,8 @@ inputs = {
input = "hello world"
unused_input = "I am unused"
}

# the existence of a `source` directive manifests the bug in https://github.com/gruntwork-io/terragrunt/issues/1793
terraform {
source = "github.com/gruntwork-io/terragrunt.git//test/fixture-download/hello-world?ref=v0.9.9"
}
12 changes: 10 additions & 2 deletions test/integration_debug_test.go
Original file line number Diff line number Diff line change
@@ -149,16 +149,24 @@ func TestTerragruntValidateInputsWithStrictModeEnabledAndUnusedInputs(t *testing
t.Parallel()

moduleDir := filepath.Join("fixture-validate-inputs", "fail-unused-inputs")
cleanupTerraformFolder(t, moduleDir)
tmpEnvPath, _ := filepath.EvalSymlinks(copyEnvironment(t, moduleDir))
rootPath := util.JoinPath(tmpEnvPath, moduleDir)

args := []string{"--terragrunt-strict-validate"}
runTerragruntValidateInputs(t, moduleDir, args, false)
runTerragruntValidateInputs(t, rootPath, args, false)
}

func TestTerragruntValidateInputsWithStrictModeDisabledAndUnusedInputs(t *testing.T) {
t.Parallel()

moduleDir := filepath.Join("fixture-validate-inputs", "fail-unused-inputs")
cleanupTerraformFolder(t, moduleDir)
tmpEnvPath, _ := filepath.EvalSymlinks(copyEnvironment(t, moduleDir))
rootPath := util.JoinPath(tmpEnvPath, moduleDir)

args := []string{}
runTerragruntValidateInputs(t, moduleDir, args, true)
runTerragruntValidateInputs(t, rootPath, args, true)
}

func TestRenderJSONConfig(t *testing.T) {