This is a AWS Lambda function deployed and hosted at Amazon. We also used the Serverless framework to handle all the necessary infrastructure needed for deploying in Amazon. Serverless also has support for Azure function and Apache OpenWhisk.
We also need to add a trigger to access our AWS lambda function. For that we added an Amazon API Gateway, that can be configured under "Trigger" in the aws lambda dashboard.
This project goes in hand with a front-end application that simply serves as a html document that triggers http call to the aws lambda function through the api gateway. The link to the front-end application that was used in this example is here - Twilio-client-example
event.json - Contains the main data structure used as payload for the lambda function to execute upon
serverless.yml - Contains the configuration needed by the serverless framework, to host and deploy on Amazon
-
To get started, first install the Serverless Dashboard Serverless Dashboard
-
Configure to your AWS Account, follow this youtube tutorial video to get you started Setting up AWS Credentials
-
Create a new service using the serverless dashboard client, and deploy your lambda function to Amazon
-
Create your twilio account so that you can use your own TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN. You also need to get your own TWILIO_PHONE_NUMBER which is a requirement when you send sms.
-
Setup your environmental variables in the aws lambda function dashboard.
-
Add a new trigger, select Amazon API Gateway
-
You should now have a custom api endpoint that you can use in your client to access your lambda function
The front-end application is a simple react application hosted in heroku.
The link to the demo live is here - Live demonstration
- Twilio SDK