I suppose you want to do an API call which invokes the Terraform script? In that case you can use the API call as a black box. Please read here how to call an API: Consume a REST service | Mendix Documentation