terratag
terratag copied to clipboard
Feat: allow using terratag as a validation tool - add dryrun
Added a new dryrun mode that checks if all resources are tagged. If a resource isn't tagged, it returns 1 exit code.
resolves #178
@TomerHeber could you please add some screenshots here or something like that so I could understand the flow and it how it looks like to the user? Thanks
@TomerHeber could you please add some screenshots here or something like that so I could understand the flow and it how it looks like to the user? Thanks
@avnerenv0
➜ terratag git:(feat-add-dryrun-#178) ✗ ./terratag -dryrun -dir ./tf2
2023/11/20 07:49:31 [INFO] Processing file tf2/main.tf
2023/11/20 07:49:31 [INFO] Processing resource [azurerm_resource_group example]
2023/11/20 07:49:32 [INFO] Resource taggable, processing...[azurerm_resource_group example]
2023/11/20 07:49:32 [INFO] Resource [azurerm_resource_group example] is taggable and tagged
2023/11/20 07:49:32 [INFO] Processing resource [azurerm_virtual_network example]
2023/11/20 07:49:32 [INFO] Resource taggable, processing...[azurerm_virtual_network example]
2023/11/20 07:49:32 [INFO] Resource [azurerm_virtual_network example] is taggable and tagged
2023/11/20 07:49:32 [INFO] Summary:
2023/11/20 07:49:32 [INFO] Scanned 1 files
2023/11/20 07:49:32 [INFO] Detected 0 untagged resources (out of 2 resource/s)
➜ terratag git:(feat-add-dryrun-#178) ✗ echo $?
0
➜ terratag git:(feat-add-dryrun-#178) ✗ ./terratag -dryrun -dir ./tf2
2023/11/20 07:51:09 [INFO] Processing file tf2/main.tf
2023/11/20 07:51:09 [INFO] Processing resource [azurerm_resource_group example]
2023/11/20 07:51:10 [INFO] Resource taggable, processing...[azurerm_resource_group example]
2023/11/20 07:51:10 [WARN] Resource [azurerm_resource_group example] is taggable but does not have tags
2023/11/20 07:51:10 [INFO] Processing resource [azurerm_virtual_network example]
2023/11/20 07:51:10 [INFO] Resource taggable, processing...[azurerm_virtual_network example]
2023/11/20 07:51:10 [INFO] Resource [azurerm_virtual_network example] is taggable and tagged
2023/11/20 07:51:10 [INFO] Summary:
2023/11/20 07:51:10 [INFO] Scanned 1 files
2023/11/20 07:51:10 [INFO] Detected 1 untagged resources (out of 2 resource/s)
2023/11/20 07:51:10 [ERROR] execution failed due to an error
dry run detected untagged resources
➜ terratag git:(feat-add-dryrun-#178) ✗ echo $?
1
talked in Slack - will change to verifing for specific tags - If tags are passed it will check for these tags... otherwise just in general...
@TomerHeber what's the status here?
@avnerenv0 - I have been busy with the provider. I will get back to it when things cool down on the provider side.
@TomerHeber it's Passover soon I have to close this :)
not deleting the branch though