I am new to AWS Lambda, I am trying to add a googles google-api-python-client to my function and what I've read so far this is the way to do it:
- I download the file locally
pip install google-api-python-client -t ./google, then zip thegooglefolder, upload it as a layer in AWS lambdaCreate layersection as a .zip file. - I do the same with another package
pip install google-auth-oauthlib -t ./google_auth - My lambda function looks like this:
from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
def lambda_handler(event, context):
return ('test')
When I run it I get:
Response:
{
"errorMessage": "Unable to import module 'lambda_function': No module named 'apiclient'",
"errorType": "Runtime.ImportModuleError"
}
How can I include these packages to be available in my script?
