AWS Lambda functions and API gateway are often used to create serverlesss applications.
Follow along with this tutorial on HashiCorp Learn.
The source files have been modified according to the tutorial.
By applying the deployment, a lamda handler and api-gateway will be provisioned.
The gateway accepts a GET request at <base_url>/hello.
The base_url is outputted in the terminal after deployment.
cd <root>
terraform apply
You will be prompted to enter 'yes' to apply changes to aws resources.
The API should now be exposed.
Test the endpoint:
curl "$(terraform output -raw base_url)/hello?Name=tomschdev"