[TEAM] - Reulan

I am submitting a hackathon project for team Reulan as a solo contributor.

Team Members: @mpmsimo

My goal for the hackathon was to take a deeper dive into the terraform-exec and understand how to invoke Terraform CLI from a Golang program. (while learning Golang!)

I’ve had an idea for quite some time now to have a CLI tool that scans multiple Terraform projects (or states) and reports Backend/Terraform information as well as if any drift is present in a easy to consume report.

Though the festive aspect is more so a secondary motivator to get the tool in a working state. For this Hackathon I figured to show my holiday spirits I would add an option to the drift report to simply make the output more festive via emojis! :christmas_tree: :fireworks: :gift:

This tool is currently in progress and is still being developed, but I was able to get a super super basic MVP completed yesterday. I have plans on finalizing report structure today and tomorrow.

Here is a very brief preview of what I am going for. This is just me grabbing information I find interesting and returning it as a report. I still need to implement the following:

  • reporting to mediums other than Discord/STDOUT
  • adding --festive CLI option to make the report pop out :christmas_tree: :fireworks: :gift:
  • parallelization of the code so that it can plan multiple Terraform projects simultaneously.

I would like to format the following data in a easy to read table, but currently I am scraping most the values that I would like at the moment.
clairvoyanceSingleProject

Also for what it’s worth, most of the coding I’ve for the hackathon recently on this project has been livestreamed on my Twitch channel under the title “Golang | Terraform Drift Detector”.

The code can be found here: reulan/clairvoyance

I should have another update and a video showing off a formatted report (even if it’s just for a single Terraform project) today or tomorrow before the end of the Hackathon.

5 Likes

I’ve expanded the tool to allow for better reporting to Standard Out.

To add some holiday spirit and cheer, the tool now has Emoji + ASCII art display in addition the formatted drift report.

Didn’t quite get it able to send to Discord in the way I want.

Things to do still:

  • parallelize (goroutines)
  • support writing of out.tfplan file
  • support parsing of main.tf to grab version used
    among others…

I have a few Terraform projects specified and I am able to see the:

  • project name (relative dir path)
  • version (version of Terraform binary used with terraform-exec) [I know this is misleading and should be version used by project]
  • Resources Changed (add/change/destroy)
  • Summary (brief description on what’s going on)

Here is a screenshot showing today’s progress!

4 Likes

Hey again!

I’ve been able to add few features to the tool today, but it’s still very much a work in progress before it can be stably and reliably used as a drift detector. Though I’ll likely add to this tool over time now that I’ve gotten over the initial hurdle.

I have uploaded a video going over how I use clairvoyance locally to generate a Drift Report at a glance.

Hope you can find the tool as amusing as I do!

Personal links:
twitch.tv/reulan (hackathon progress livecoded as “Golang | Terraform Drift Detector”)
reulan/clairvoyance (source code on GitHub)
reulan.com (more about me!)

3 Likes

This is brilliant, I have been wanting to dig into this myself. Your Twitch show looks great too.

1 Like