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

Introduce --terragrunt-strict flag for validate-inputs #1757

Merged
merged 14 commits into from
Aug 4, 2021

Conversation

zackproser
Copy link
Contributor

@zackproser zackproser commented Jul 26, 2021

Fixes #1603

These changes introduce the --terragrunt-strict-validate flag which enables the behavior outlined here.

By default, terragrunt's validate-inputs command runs in relaxed mode. In relaxed mode, validate-inputs only returns an error if there are required inputs that are missing.

By passing --terragrunt-strict-validate, strict mode is enabled. When strict mode is enabled, Terragrunt will return an error if any required inputs are missing, OR if any variables that are passed in a Terragrunt configuration are NOT used in the underlying Terraform configuration.

@zackproser zackproser changed the title [WIP] Introduce --terragrunt-strict flag for validate-inputs Introduce --terragrunt-strict flag for validate-inputs Jul 26, 2021
Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation LGTM! Just had a few nits about logging, and a concern about the UX around flag name.

cli/cli_app.go Outdated Show resolved Hide resolved
cli/validate_inputs.go Outdated Show resolved Hide resolved
cli/validate_inputs.go Outdated Show resolved Hide resolved
Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates almost LGTM! Just one more var name change for maintainability and I think this will be good to go!

cli/args.go Outdated Show resolved Hide resolved
cli/validate_inputs.go Outdated Show resolved Hide resolved
Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates LGTM! The test failed, but I'm not sure if it is legit. I just kicked off another build, and if it fails, I'll investigate to see if it is related to this change.

Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup build was a transient failure - it passed on retry. This is good to go!

@zackproser
Copy link
Contributor Author

Thanks for the reviews Yori!

@zackproser zackproser merged commit 97d434e into master Aug 4, 2021
@zackproser zackproser deleted the terragrunt-strict branch August 4, 2021 14:21
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

Successfully merging this pull request may close these issues.

Terragrunt configuration has misaligned inputs
3 participants