Elastic Beanstalk + Git + EB Extensions

Dan Kaplan
2 min readJul 23, 2021
Octocat has got the git in his blood

One day I was attempting to deploy a Ruby on Rails application to Elastic Beanstalk. The Elastic Beanstalk instance started to spin indicating it was working, and when it was finished the beautiful green check mark appeared. But when I typed in my url, nothing appeared! I decided to ssh into my EC2 instance to observe the logs, and nothing was in there. There was no code in my EC2 Instance :( Enter Panic Mode!

I tried deploying again… same thing happens. I try googling around and making changes to all of my different configurations on my Rails App and my Elastic Beanstalk app…. same thing happens. Still no code on the box!

Finally, I spotted the problem! One of my Gems for my project was linked to and installed via a git repository. In order for this Gem to be installed, Git is needed, and to my shock Git is NOT included by Default on an Elastic Beanstalk Instance.

OK, so easy fix right? I ssh back into the EC2 instance and run

sudo yum install git -y

Bang, my next deploy works perfectly! Surely, I will never run into this problem again….. But a few days later, Beanstalk switches EC2 Instances and my code doesn’t appear again!

To solve this problem, I looked to Elastic Beanstalk Extensions. Elastic Beanstalk extensions are files you add to your…

--

--