I am relatively new to python and even newer to Lambda. I have created a lambda function that requires some external dependencies (elasticsearch
and elasticsearch-curator
).
My root folder is called index_curator
, in which I have one single python file main.py
. I installed the dependencies via pip
as per Amazon's instructions e.g.
pip install elasticsearch elasticsearch-curator -t /path/to/index_curator
There are now many other files in this root directory and many child directories, which is not a surprise as these dependencies are quite large. For someone else looking at this package it would be difficult to differentiate between files I wrote and external dependencies. For example:
index_curator/
dateutil/
click/
idna/
main.py <-- the only file I wrote
README
LICENSE
six.py
...
Is there any way of shifting all these external dependencies into a sub-folder, e.g.
index_curator/
/external/
dateutil/
click/
idna/
README
LICENSE
six.py
main.py <-- the only file I wrote
For completeness the imports in main.py
are:
from elasticsearch import Elasticsearch, RequestsHttpConnection
import curator
Any pointers would be appreciated.