Skip to content

Helps you search and filter resource instances from the output file generated by `terraform validate -json` or `tofu validate -json`

License

Notifications You must be signed in to change notification settings

ivica-k/terraform-validate-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-validate-explorer

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.

Get it

Prebuilt binaries

Look for a release binary for your operating system on the Releases page.

From source

No binary available? Clone this repository and:

pip install -r requirements.txt
python main.py

Features

"contains" filter

Search for all resources that have tables_future_read in the name (Snowflake "future" grants are amazing btw!)

"does not contain" filter

To verify that only snowflake_ resources are deprecated, I filtered all the warnings that do not contain the word snowflake:

"regex" filter

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:

"Only unique" toggle

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.

Testing

For information about testing and how to run it Here

Contributors

terraform-validate-explorer has more features and less bugs thanks to:

About

Helps you search and filter resource instances from the output file generated by `terraform validate -json` or `tofu validate -json`

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published