Dog

AWS lambda python scheduler

Install pyCharm

https://www.jetbrains.com/pycharm/download/#section=mac

Install SAM CLI on macOS

https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-mac.html

Create Credentials

https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html

Add Credentials

https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/setup-credentials.html

Install AWS Toolkit Plugin

which sam
which aws


#Install Serverless CLI

#on mac
npm install -g serverless 

#on windows
choco install serverless

Serverless Getting Started Guide

Create example project

# type 
serverless

https://github.com/serverless-components/fullstack-app

Make use of python dependencies

npm install serverless-python-requirements –save-dev

serverless plugin install -n serverless-python-requirements

https://www.serverless.com/blog/serverless-python-packaging/

https://www.serverless.com/plugins/serverless-python-requirements

https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

Create a SAM template from serverless framework

npm install serverless-sam –save-dev

serverless plugin install -n serverless-sam

https://www.serverless.com/plugins/serverless-sam/

Debug

Debug Offline

npm install serverless-offlinesave-dev

serverless plugin install -n serverless-offline

https://lumigo.io/debugging-aws-lambda-serverless-applications/

Debug Lambda function

https://www.jetbrains.com/pycharm/guide/tutorials/intro-aws/invoke-local/

https://docs.aws.amazon.com/toolkit-for-jetbrains/latest/userguide/invoke-lambda.html

Aws lambda

https://www.serverless.com/blog/lambda-at-edge-support-added/

Using api keys

Serverless Framework - AWS Lambda Events - API Gateway here

To call a key secured based lambda function

add an x-api-key header with the key as its value

Using a custom domain

yarn add serverless-domain-manager

serverless create_domain --stage prod && serverless create_domain --stage staging

https://wb.serverless.com/blog/serverless-api-gateway-domain

https://www.serverless.com/plugins/serverless-domain-manager/