Closed peter-t-kim closed 5 years ago
I haven't compared actual CLI command times between local and in Lambda. If I had to guess, I would say it has to do with some caching and/or initialization. I'm not super familiar with the internals of the CLI, but I'd guess when running it locally your responses are getting cached at edge locations and the CLI is already initialized with everything it needs. When running in Lambda it's like a new computer each time so it might take a little extra initialization. Not to mention Cold Starts.
Have you tried setting an environment variable in your Lambda configuration of HOME=/tmp
. Maybe even try os.environ['HOME'] = '/tmp'
in your Python code.
Yes I actually just realized I never tried manually setting the ENV vars in the console! So silly of me!!
Thanks for all the help--much appreciated.
Hi @gkrizek ,
Do you have any idea why the aws cli commands run so slowly using this bash-lambda-layer? On my local they take ~2 seconds but on the lambda they take ~15 seconds.
Because the aws cli takes so long, I want to use Boto3 instead, but I need $HOME to be writable for gpg. How would one create a custom python3 layer with the $HOME=/tmp as is done in the bash bootstrap?
Thank you!