Terraformize - Apply\Destory Terraform modules via a simple REST API endpoint.

naorlivne

New member
Local time
03:53
Joined
Oct 20, 2019
Messages
2

I started a project to manage Terraform runs via API requests, the basic idea is that you make an API request and the service runs Terraform apply\destroy for you and return the response to the request body, the idea beyond it is that there are cases (for example a DBaaS provider creating on demand clusters for each of his clients) that you might want to have your code run terraform which is a lot easier to accomplish if you have a microservice in charge of running terraform for you.

Some highlights include:

  • REST API to run:
    • terraform apply
    • terraform destroy
  • No code changes needed, supports 100% of all terraform modules unmodified
  • Built in support for multiple terraform workspaces
  • Can pass variables to the terraform run via the request body (passed as a -var arg to the terraform applyor terraform destroycommand)
  • Supports multiple module directories
  • Automatically runs terraform init before changes
  • Returned response includes all the logs of stdout & stderr of terraform for easy debugging
  • Stateless (requires you use a non local terraform backend)
  • Containerized
  • Health check endpoint included
  • support all terraform backends that support multiple workspaces
  • No DB needed, all data stored at the terraform backend of your choosing
  • terraformize scales out as much as you need risk free (requires you use a backend that support state locking)
  • AMD64 & Arm support (Arm64 not supported as there is no current binary for Terraform for it)
If you want to read\try the project it's located at (example included at the end of the readme): naorlivne/terraformize

 
Last edited:
Upvote 0

tom

Creator of StickerRun®
Community Team
Local time
02:53
Joined
Oct 13, 2019
Messages
258

Wow this is awesome! Great work you did there 😍
I'm currently in the conception phase for a project and one big problem that I had was "I want to trigger my stuff using an API, but the terraform api access layer is umm... Yeah there's not much there and creating a custom API server looked like too much work to do.". So THANK YOU SO MUCH for creating this and sharing it. This helps me a lot!

How long did you work on this? And if I may ask, how did you start with Terraform?

 

naorlivne

New member
Local time
03:53
Joined
Oct 20, 2019
Messages
2

It's still new project so this is still a first "public" release, only started work on a couple of months ago.

Been using Terraform for years now as I work full time as a DevOps engineer so even if this is a new project it's not without thought of Terrraform inner working.

Would love hearing how you plan on using it & your experince once you get the ball rolling.

 

tom

Creator of StickerRun®
Community Team
Local time
02:53
Joined
Oct 13, 2019
Messages
258

I'll be using it with docker mostly to automate 3rd party services and build docker networks or even swarms. The API will be called by a few backend jobs that will trigger what needs to be done and pass the data to the API/Terraform that should do all the work in the end.

I'm still quite new to the whole infrastructure as code stuff but I'm willing to learn and want to dig deeper into this in the next few months.

The question I had was Ansible or Terraform, as Chef was too enterprise for the stuff I want to do. Your API makes the decision easier and my first intention was Terraform too, so I'll try to get things working with Terraform.

 
Top