Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a Vagrantfile that matches Elastic Beanstalk?

We're putting together a PHP site that we plan on deploying to Elastic Beanstalk, and I'd like to create a virtualized dev environment to match production. I've got a few questions about it, though.

So it looks like I can use vagrant-aws and feed it a custom AMI - presumably one that would be created by Beanstalk. Will this actually work, though? It seems like it uses rsync to copy any new files up. Is that going to slow down development as I wait for it to sync up?

More importantly, it seems like this relies on a network connection if you want to do any development. Is it possible to take it offline so I can develop without a connection (e.g. on a plane, on a bus, etc.)?

As an alternative, has anyone put together a Vagrantfile that matches the packages and setup of Elastic Beanstalk? I couldn't find anything in my searches, but maybe I was looking in the wrong spot?

Finally, are there any recommendations for pulling off this sort of dev testing? Am I thinking about this the right way, or is there a better way to do this?

like image 410
greggilbert Avatar asked Dec 23 '13 08:12

greggilbert


1 Answers

I'd say that the cleanest way is to use a tool like Packer to create an image for both EC2 and Vagrant. That way you control the image you're using and you know it's the same for both EC2 and Vagrant.

Elastic Beanstalk can be handed a custom AMI and if your devs have the vagrant box downloaded they can work when disconnected.

It's not the easiest option since you have to configure all the packages on the image yourself but it's a good way to keep your dev boxes and production boxes in sync.

like image 119
Conor McDermottroe Avatar answered Sep 22 '22 03:09

Conor McDermottroe