I have a file with this as the contents.
def print_hello_world():
print ('Hello World')
It's zipped up in a folder with a __init__.py
file.
I add this as the layer and set the correct runtime of python3.6.
How do import it into my lambda function via lambda code?
Edit: After researching I found that lambda mounts the layers at /opt and if you add /opt to your syspath via sys.path.insert(0, '/opt') then you can import your layers.
You can see your layers at: print(os.listdir("/opt"))
There's gotta be a more elegant way to do this!