Windows Service Deploy for ec2

Asked

Viewed 91 times

2

Currently when I need to make the automated deployment of my web application to Amazon’s EB (Elastic Beanstalk), I use the command line tool below:

C: Program Files (x86) AWS Tools Deployment Tool awsdeploy.exe

For her, I can pass a configuration file with S3 Bucket information, authentication and environment to deploy. This tool updates all machines that are managed by ELB.

However, when I need to have this same behavior for windows services on ec2 machines I don’t have that same ease.

Currently the only way I have in mind to work is to start the machine manually and install the service. If the service needs updating I have to enter manually on each machine the service is running or make the service itself know whether to auto-update.

However, even if the service can upgrade itself, the first installation has to be manual.

Is there any way to deploy and install services on windows machines on Amazon EC2?

2 answers

2


There are several ways to do this. Here are just a few suggestions. Depending on how critical your service is (whether it can go off the air for a few moments, or not) one of these may suit you:

  1. Use Cloudformation to upgrade the entire stack. If you’ve never used it directly, there’s a learning barrier but it’s worth it. Beanstalk for example is little more than a Cloudformation template with a GUI.
  2. Install the service on one (or all) Beanstalk application machines. That article in two parts covers that scenario.
  3. Use Chef or Puppet to distribute the update to all machines running the service(s)).
  4. Create an AMI that already comes with another service responsible for updating the main service, possibly monitoring some S3 Bucket, downloading the new version, stopping the main service, updating the files and restarting the service. Basically reinventing Chef or Puppet.
  5. Write your own AWS scripts to create an AMI for each update (there is a tool called Packer which can help) and recreate/replace the EC2 machine every Deployment. This is relatively common using Linux, maybe with Windows it will be more time consuming. Although time consuming this can be the alternative with less downtime as it can wait until the new version is fully ready to work (or already working) and only then disable the old.

0

Elastic Beanstalk (do not confuse with Elastic Load Balancer / ELB) has a customization mechanism, files . config in folder. ebextensions, in which you can declare commands to be executed and services to be started, among other options. See more details in the Elastic Beanstalk documentation: Customizing Software on Windows Servers.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.