Provision AWS infra using API

Hi.
is there any example or API to create the AWS infrastructure using Terraform API?
for eg: I would like to create a EC2 instance on AWS using terraform programmatically and not from CLI from my local system.
any leads are welcome.

thanks,