terraform-validate-explorer
is a tool that helps you search and filter resource instances from the output file
generated by terraform validate -json
or tofu validate -json
. Those files can easily be longer than 50000 lines so
filtering their contents can be of help while upgrading Terraform/OpenTofu provider versions and dealing with deprecated
resources.
Look for a release binary for your operating system on the Releases page.
No binary available? Clone this repository and:
pip install -r requirements.txt
python main.py
Search for all resources that have tables_future_read
in the name (Snowflake "future" grants
are amazing btw!)
To verify that only snowflake_
resources are deprecated, I filtered all the warnings that do not contain the word
snowflake
:
If the other two filters are not cutting it for you, you can always do it with one of the world's write-only languages.
Suppose you want to look for a resource instance that has future_
in the name, followed by a four-letter word that is
at the end of the resource name:
This toggle works in combination with any filter to show only unique resource addresses. This feature is useful when validating many resources created by the same module.
What is a "unique resource address"? If the full resource address is module.snowflake.module.my_infra.snowflake_grant_privileges_to_role.functions_future_read
,
then a unique resource address is snowflake_grant_privileges_to_role.functions_future_read
. See below for an example.
Searching for snowflake_grant_privileges_to_role.tasks_future_write
yields 60 warnings, but if you look closely -
it is the same resource, from the same module, just used many times.
Toggling the "Only unique" checkbox reveals that it is in fact just one resource, defined in a single module.
For information about testing and how to run it Here
terraform-validate-explorer
has more features and less bugs thanks to: