Where can I run terraform?

570 Views Asked by At

This is mostly a research question as I can't seem to find out where I can run Terraform for my use case.

I want to build a web front end which I can enter details for configuration, click a button and the front end would tell Terraform to build the infrastructure. I understand I can use the cli, or create a .tf file and then use Jenkins to run it. But I'm looking for a way to basically call the Terraform cli commands through events like a lambda call.

Should I use cloud provider sdks for this?

Has anyone gone about doing something like this and if so, could you share your experiences?

2

There are 2 best solutions below

0
On

You can use SLD (Stack-Lifecycle-Deployment)

It has a very cool ui and rest api

5
On

I think I found something really useful!

Lambda Terraform Call using Python

This would be what I had in mind, generate a Terraform plan file, drop into an S3 bucket, then invoke the lambda call to spin up the infrastructure. And all can be done with the front end configuration setting and an API call.

I hope this comes in handy for some other people and once I have it working I might come back and add to this.