AWS SES DYNAMODB tutorial using Serverless Framework written in Python
Command | Description |
---|---|
npm install -g serverless |
Install Serverless CLI |
npm install |
Install Serverless dependencies |
Set up an AWS account with admin permissions | Documentation |
$ git clone https://github.com/faizanbashir/python-ses-dynamodb-contactform.git
$ cd python-ses-dynamodb-contactform
$ npm install
$ sls deploy -v
The service exposes 2 REST API endpoints:
Endpoint | Description | Parameters |
---|---|---|
POST /sendMail |
Submit the data from contact form | {"firstname": "John", "lastname": "Doe", "email": "[email protected]", "message": "Hi there"} |
GET /list |
Retrieves all the contact form submissions | - |
curl ---header "Content-Type: application/json" \
--request POST \
--data '{"firstname": "John", "lastname": "Doe", "email": "[email protected]", "message": "Hi there"}'\
<host>/sendMail
curl <host>/list
Deploy only one function:
sls deploy function -f <function-name> -v
Run a specific function with a provided input and get the logs
sls invoke -f <function-name> -p event.json -l
Run a specific function without input and get the logs
sls invoke -f <function-name> -l
Tail the logs of a function:
sls logs -f <function-name> -t
Information about the service (stage, region, endpoints, functions):
sls info
Just use it on anything:
sls help
or
sls <command> --help