Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using vagrant on EC2

Tags:

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.

like image 874
fortm Avatar asked Jun 01 '13 07:06

fortm


People also ask

Can I use vagrant with AWS?

Vagrant will launch an AWS instance through the AWS AMI provided in the configuration using the credentials provided in the Vagrantfile. You can view the newly created instance in the AWS console panel. You can now SSH into your AWS instance or perform other Vagrant operations.

What does vagrant up do?

Command: vagrant up [name|id] This command creates and configures guest machines according to your Vagrantfile. This is the single most important command in Vagrant, since it is how any Vagrant machine is created. Anyone using Vagrant must use this command on a day-to-day basis.

What is a vagrant box?

A Vagrant Box is a clone of a base operating system image. Using a clone speeds up the launching and provisioning process. 1. Instead of using the init command above, you can simply download and add a box with the command: vagrant box add ubuntu/trusty64. This downloads the box and stores it locally.

What is vagrant virtual machine?

Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the “works on my machine” excuse a relic of the past.


1 Answers

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...

like image 59
Matt Cooper Avatar answered Oct 07 '22 03:10

Matt Cooper