Terraform - Triger Script via HTML/Web

Hello All,
I am just looking for some guidance to trigger a terraform script via my website/html page. I will write terraform script for my users. Users will visit the website and login via their credentials. They will find a tab/button showing the infrastructure they would like to enable e.g “Infra for Static Website”. They will click on it and the infrastructure will be provisioned for them.

I am looking for guidance to achieve the above. How to integrate html with terrafom? My apologies, i am not a web developer myself and have limited knowledge in this domain.
In the second stage, i would also like to script to create a new user with limited privileges on the cloud platform and display the credentials to my user for logging in to the cloud console.

Appreciate your inputs.

Hi @nomykhan,

Terraform CLI itself has no feature for this: it’s just a command line tool and so although you can write scripts to run it, it’ll be your responsibility to arrange for those scripts to run in response to actions taken on a web page.

Depending on your goals, you might consider using Terraform Cloud, which is itself a web application that wraps Terraform CLI. This won’t directly allow you to integrate with a web application you’ve created yourself, but if your requirement is just that it be possible to start a Terraform run from some web UI then the Terraform Cloud UI could perhaps be it.

Otherwise I expect you’ll need to engage with a developer to construct a custom solution. In that case, the developer might choose to implement a wrapper around Terraform CLI themselves, or they might choose to still use Terraform Cloud but to start Terraform runs using the Terraform Cloud API.