This project is a simple HTTP API with Python running on AWS Lambda and API Gateway using the Serverless Framework. Also integrates the Datadog APM spans.
You can find the orginal template in the Serverless Examples Repo. This project was based on a MacSantos' project.
- Access to your Datadog's Account
- Access to your AWS Account via CLI
- npm, yarn commands
- Serverless Framework CLI version 3. See Serverless Framework docs
Fill in YOUR DATADOG API KEY, YOUR AWS PROFILE, YOUR NAME in the serverless.yml
file.
Install the serverless-plugin-datadog:
$ cd python-serverless-api
$ npm install
Deploy the serverless stack:
$ serverless deploy
After deploying, you should see output similar to:
Deploying python-serverless-api to stage dev (us-east-1)
โ Service deployed to stack python-serverless-api-dev (140s)
endpoint: GET - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/
functions:
hello: python-serverless-api-project-dev-hello (2.3 kB)
After successful deployment, you can call the created application via HTTP:
https://xxxxxxx.execute-api.us-east-1.amazonaws.com/
Delete the serverless stack:
$ serverless remove