Snippet from code:
#!/usr/bin/env python3
import os
import traceback
from jwt import JWT
from botocore.vendored import requests
import time
def lambda_handler(event, context):
app_id = $$$
payload = {
# Issued at time
‘iat’: int(time.time()),
# JWT expiration time (10 minutes maximum)
‘exp’: int(time.time()) + 600,
# GitHub App’s identifier
‘iss’: app_id
}
# Create JWT
jwt_instance = JWT()
encoded_jwt = jwt_instance.encode(payload, signing_key, alg=‘RS256’)
I am getting the following error in my python function for Aws Lambda. It is working locally.
Error:
errorMessage”: “Unable to import module ‘uploader’: No module named ‘jwt’“
I have tried adding lambda layer for JWT, Pyjwt. But no luck.
I am using this path in my lambda layer: python/lib/python3.9/site-packages/(jwt packages).
I have tried changing my lambda layer for Jwt package with Jwt, Pyjwt but it didn’t help
Kunal Sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.