Vagrant, AWS, environments; need help setting up several environments

Hello I'm confused on how to go about this.

I'd like to set up a dev, test, production environment.

The production would be on aws. Test will be on a local computer for users in my company to test. Dev will be on personal computer of programmers.

I'd like to build feature on dev and push it out on test for testing before pushing it out on production (aws).

How do I go about doing this?

I don't think repacking dev as an image and putting it on test and then repacking test to put on production is the way to go. The fact that I also have to reupload production db's sql is wrong.


I can see saving my code to github, ssh into test to download the github code for testing. And then some how push current state of test to production? I can grab git code from github and push to production once tested.

That would probably work.

How do I go about backing up production's current state?

Thank you for your time!

1 thought on “Vagrant, AWS, environments; need help setting up several environments”

  1. Use vagrant locally, using a base box (say centos). Make it use puppet or chef to configure it.
    When ready to test, just have a CI watching for your branch to run tests.
    If those pass, use packer with the same (puppet or chef) provisioner, using the same manifest to generate an AMI for prod.


    $ git checkout -b feature/new-feature
    $ vagrant up #vm comes up, .vagrant/manifests/default.pp runs, gets it ready
    $ modify your files, get it where you want it, tests pass locally
    $ git commit -a -m ‘feature done’

    CI picks up your changes, runs tests.
    Tests green, runs packer build myapp.json, where myapp.json:

    # runs .vagrant/manifests/default.pp #now it’s at the ready state with no app
    # runs shell provisioner to make your app usable, makes service start at startup, whatever needs to happen
    # creates aws AMI that has your app with your new feature

    Now, in UAT, spin up your AMI, verify it’s good. Good? Spin up the AMI in prod.

    I dumbed this down alot, but this is the 1000ft view of how we do it, and the method works great.


Leave a Comment