Tojo Chacko
Tojo Chacko

Reputation: 1280

How do I go about with Amazon EC2 self deployment?

I have a Amazon Ec2 architecture where I have multiple servers attached to a ELB server. I do manual scaling of servers and attach more servers as and when needed, depending on the traffic requirement.

I deploy my application using Capistrano and currently while attaching new servers I always have to manually check if the new server has new application version and if not, make a deployment to the new server.

I wanted to know if there is a cleaner practice of the new server auto updating itself with the new application codebase if it finds itself outdated. I tried to use Amazon CodeDeploy, but it does not solve my purpose. It just provides me a deployment management console. Does Amazon provide a way where when the server comes up, it tries to self deploy ?

Thanks in advance.

Upvotes: 0

Views: 68

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269151

The easiest method for you might be to use a User Data script when your Amazon EC2 instances launch.

This involves providing a script that is automatically run when a new instance starts. This script could download and install software, register the new server with a central monitoring system, update a configuration, etc. Some companies use the scripts to launch a configuration management system such as Chef, Puppet or Ansible.

Here's some details:

Another option is to use pre-configured Amazon Machine Images (AMIs), which have all the new software already installed. Launching new instances from the updated AMI means they already have the software installed.

Of course, this would require creating a new AMI with every software release. Some companies have automated this process with tools like Netflix Aminator and Packer.

Upvotes: 2

Related Questions