-
Notifications
You must be signed in to change notification settings - Fork 38
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
Terragrunt support #65
Comments
The following approach can be used
terraform {
extra_arguments "auto_plan_file" {
commands = [
"plan",
]
arguments = ["-out=tfplan.output"]
}
} Next run the following: find . -name tfplan.output -exec tf-summarize {} \; But I don't really like the output. I think there is a need to add some filtering for resources that are not being updated: +--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+
+--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+
+--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+
+--------+----------+
| CHANGE | RESOURCE |
+--------+----------+
+--------+----------+ |
+1 to terragrunt support. This would be a huge DX and quality-of-life improvement. I'd donate money to see that developed. |
It would be great to have terragrunt support, the logs there are far from the ideal size. |
Likewise we'd love terragrunt support! |
+1 for terragrunt support. |
tf-summarize works on plan generated from the issue here is Alternate solution:
|
Thanks @prabhu43 and @yyarmoshyk for the comments with steps to use tf-summarize with terragrunt. Is this helpful? Or do you expect different support in tf-summarize? if yes, you can please provide details on the requirement. cc: @rmittal123 @tide-jamiegwatkin @thiagomaeda @armenr @Alexey-Tsarev |
While this works for individual plans, it seems to lack a way to execute a final command after all plans to summarize without a second command invocation: terraform {
extra_arguments "auto_plan_file" {
commands = ["plan"]
arguments = ["-out=$TF_PLAN_NAME"]
}
after_hook "after_hook" {
commands = ["plan"]
execute = ["sh", "-c", "find . -name $TF_PLAN_NAME -exec tf-summarize {} \\;"]
}
extra_arguments "summarize" {
commands = ["plan"]
env_vars = {
TF_BINARY = "tofu"
TF_PLAN_NAME = "plan.cache"
}
}
} Currently this has to be scripted out of Terragrunt: export TF_BINARY=tofu TF_PLAN_NAME=plan.cache
find . -name plan.cache -exec sh -c 'plan="{}"; cd "${plan%'"$TF_PLAN_NAME"'}" && tf-summarize -json '"$TF_PLAN_NAME" \; | jq '.[] | select(keys | length > 0)' Maybe this could be solved in Terragrunt with a new Note: the output of |
Hi! You have an interesting util, but suddenly it does not work with Terragrunt.
I tried, but I got the following error:
The text was updated successfully, but these errors were encountered: