Deploy untracked files with git and elastic beanstalk

While deploying an update to (transitioning the site over to node.js so that we can use Mailchimp’s server-side API), I ran into an issue where Elastic Beanstalk’s integrated eb deploy feature will only deploy files git is tracking when a git repository is present.

If you want to deploy API Keys, but don’t want them tracked in git, this presents a problem.

I took to twitter to ask for help:

The responses trickled in:

This is… sub-optimal, to say the least.

Luckily, a member of the Elastic Beanstalk team responded:

And further elaborated:

Excellent! By adding an .ebignore file that is set up to ignore files I don’t want deployed, I can ensure that all of my project files are deployed. The .ebignore is in fact, an .ebdontdeploy.

This is a very new development; so new that it was still being requested in April. My hat’s off to the Elastic Beanstalk team (and especially Nick Humrich) for cluing me in to it. I only wish it was linked to by other parts of the Elastic Beanstalk 3.0 CLI docs.

If you need to deploy files that aren’t tracked by git to elastic beanstalk, .ebignore is the answer.