I'm a developer, so not nearly as experienced as I would like to be with server administration. Essentially, I am trying to figure out how to create a base image (AMI) that can be used in development, testing, staging, and production.
DEVELOPMENT
My thoughts thus far have been using Packer to create an AMI, but also export it as a Vagrant box. Then for development we should be able to easily vagrant up
into the same type of environment as production uses. I've been testing this and so far am unable to build an EC2 instance successfully thanks to weird SSH issues...but that is a topic for another question.
TESTING
We are trying to use Atlassian Bamboo to create a build server. It can load an AMI and spin up an EC2 instance on AWS to run the build/test process. I'm thinking we would have it load the AMI generated in the development stage, not sure if this is possible. Has anyone else done this?
STAGING
When the build/tests pass in Bamboo, we would push the code to a release branch and test it in staging which, as you may have predicted, would also use the same AMI.
PRODUCTION
Finally, when the code is tested, it gets bumped to the master branch and deployed on the master server(s) also running the same AMI.
In theory, this all sounds so simple and straightforward. In practice, it is a configuration nightmare. Is this a reasonable process and should I push through to figure it all out, or is there a better way of doing this? Should I just manually write a bash script that uses the AWS console tools to do all of this?