Static code analysis of code has been there for quite a while now and it is very useful now in case of configuration as code scenario as well. Often, we make mistakes in our configuration code (HCL or not), but if you are using Terraform HCL then TFSec is a good choice. When I tried, I was up and running within 5 to 10 minutes, soon followed by CI with Github actions. I like docker in general, so took the docker approach, which hopefully makes it more usable across environments.
Festive Tech Calendar 2020
This demo is designed as my contribution for Festive Tech Calendar 2020, definitely check out the website for some many other great topics. Happy Christmas.
This video is part of the festive tech calendar 2020.
All the code shown in the video is available at https://github.com/realrubberduckdev/terraform-static-analysis.
Hope this was useful and saves you some time if you are trying this out. Please do share your learnings. If you have any thoughts or comments please do get in touch with me on Twitter @rubberduckdev. Or use the Disqus plugin below.