aws-lambda
and initialize a new project by
creating lambda_function.py
This example uses Makefile, but the scripts can
also be written for Pipenv
.
PyJwt
for decoding the JWT token in our code. We will install the
package in the zipping stage.
verify
function will handle the actual verification of the signature. The
signature itself is actually a JWT and includes claims about
the request. See here.
Python 3.8
as runtime, then create the function.
Configuration
tab:
Auth Type = NONE
because we are handling authentication ourselves.
After creating the url, you should see it on the right side of the overview of
your function:
Configuration
tab from earlier, we will now set the required
environment variables:
Makefile
file (or corresponding pipenv
script):
make zip
this will install PyJwt and zip the code.
Afterwards we can click the Upload from
button in the lower right corner and
deploy the code to AWS. Select lambda.zip
as upload file.