Closed SlavaSubotskiy closed 2 years ago
Very good timing :) I have just started implementing this as a pre-commit-hook in https://github.com/antonbabenko/pre-commit-terraform/issues/202 an hour ago.
I will extend it with the support for defaults
like you propose.
Let's keep this PR open for a while.
This issue has been resolved in version 3.6.0 :tada:
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
Inspired by https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/tree/master/wrappers
Motivation and Context
We are using Terragrunt to launch multiple EC2 instances with similar configuration. To keep DRY, we had to implement a wrapper module with
for_each
implementation. The only difference between this wrapper and the https://github.com/terraform-aws-modules/terraform-aws-s3-bucket/tree/master/wrappers, is that thedefaults
variable was added, to support more DRY configurations in case of similar instances configuration(see example in the README) The main.tf was generated by a dummy bash script:Breaking Changes
No breaking changes introduced
How Has This Been Tested?
terraform fmt
/terraform validate
/tflint
executedterragrunt plan
reviewed for configurations with and withoutdefaults
defaults