How does one import the assets of a shared lambda layer? Following this, I have created the lambda layer, added shared code to the layer. added the layer to a function. now in the lambda function that is using the layer, how do you use the files dropped in the opt folder of the layer created? The documentation says you can look for files in the opt path of the lambda layer. But what if there are multiple lambda layers? How do you narrow the opt path down to the specific layer?
EDIT
My new folder structure as below. I am trying to call the common shared utility class called my_utils in the file myClass.py from Index.py and have dropped the layer function file in both site-packages folder as well as the opt folder
app-root
-amplify
-backend
-function
-myLayer
-lib\python\lib\python3.8\site-packages\myClass.py
-opt\myClass.py
-amplify
-backend
-function
-myFunction
-Index.py
Below are the various combinations I tried for importing in my calling handler Index.py
from myClass import my_utils
import myClass
import my_utils
With the above arrangements and import statements, I am still getting a ModuleNotFoundError