Using downloaded NLTK data on AWS Elastic Beanstalk
<p>I have a django app running on AWS Elastic Beanstalk. I use an <code>nltk</code> corpus package (<code>stopwords</code>) which I obtain by using the NLTK downloader.</p>

<p>For a quick hack, I just ran the nltk downloader on my current (single) elastic beanstalk EC2 instance and saved the needed corpus to <code>/usr/local/share/nltk_data</code>. This works on a single instance but obviously when my load balancer decides to create new instances this will be wiped (it survives deployments). </p>

<p>My question is what is the best approach here specifically for this data? </p>

<p>Should I store it on S3 and tie that to my elastic beanstalk? </p>

<p>Or, is it easier (and better) to write a (python?) script that will be called by the EB configuration for each new instance that will download and place the data in a folder accessible by the app (for the life of the instance)? That way if I need to add other corpus downloads or do python-specific or nltk-specific things it's happening in python and not requiring manual S3 work?</p>

<p>If someone supports writing a script for EB configuration, an example would be great, I am not sure how to do this exactly.</p>

<p>Thanks!</p>