Using vagrant on EC2

2019-03-14 11:15发布

问题:

I need to setup a web server and a database server on EC2. It should be easy to migrate to another service provider later.

Currently, I have a web server and a database server, each running on separate EC2 micro instances with software installed there remotely.

Can we run a vagrant box on these micro instances with pre-installed and pre-configured softwares like LAMP stack and use that instead. So I will end with 2 vagrant boxes , one for web server another for database server.

Amazon provides already means to copy an instance but it is copied to another EC2 instance only probably .. If there is need to move to some other provider, it will be same process of re-installing all. So, an own virtual box installed on Amazon's virtual box is what i was looking into..

I don't know how good or bad it is.. I doubt if this will affect performance as well. Please share your views. Target is to have env prepared locally and have flexibility to deploy it on any service provider easily.

回答1:

Running vagrant inside your AWS box is probably not the right solution. Have you looked into the Vagrant AWS provider?

That will allow you to setup and provision your AWS boxes with Vagrant and Puppet or Chef... if you are using Puppet or Chef to provision your servers then you will have a very portable "scripted" install for your servers that can easily be moved to another provider at a later date...