I want to access my lambda layer via Cloud9

0

I have developed some code on my local PC from which I created a lambda function which contains environment variables and a layer with my libraries. When I run the code it works. I have decided that I really should be developing this code using Cloud9 so I can debug it when I make more changes. I have been able to access my code OK via the AWS explorer but when I attempt to run it I notice that it falls over because it cannot locate a library. I realise it is not accessing the layer I uploaded, the error message is "ModuleNotFoundError: No module named 'tweepy'". So how do I access the existing Lambda layer I created, but this time in Cloud9?

gefragt vor einem Jahr241 Aufrufe
1 Antwort
1

In context of this scenario, Cloud9, is just like your desktop. It does not have visibility to Lambda function or layers any more than your desktop.

You can achieve this by using AWS SAM. This article explains how you can use AWS SAM to download and cache external layers - https://aws.amazon.com/blogs/compute/working-with-aws-lambda-and-lambda-layers-in-aws-sam/

AWS
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen