Deploy windows service for ec2

2

Currently when I need to do the automated deploy 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 do not have that same facility.

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 manually enter each machine that the service is running or make the service itself know how to auto-update.

However, even if the service can update itself, the first installation must be manual.

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

    
asked by anonymous 22.12.2015 / 00:17

2 answers

2

There are several ways to do this. Here are just a few suggestions. Depending on how critical your service (if it can go out of the air for a while or not) it may be that one of these serves you:

  • Use CloudFormation to update the entire stack. If you have never used it directly, there is a learning barrier but it is worth it. Beanstalk for example is little more than a CloudFormation template with a GUI.
  • Install the service on one (or all) Beanstalk application machines. This article in two parts covers this scenario .
  • Use Chef or Puppet to distribute the update to all machines running the service (s).
  • 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.
  • Write your own AWS scripts to create an AMI for each update (there is a tool called Packer that can help) and recreate / replace the EC2 machine with each deployment. This is relatively common using Linux, perhaps with Windows being more time-consuming. Although slow this can be the alternative with less downtime because you can wait until the new version is fully ready to work (or already working) and only then deactivate the old one.
  • 30.12.2015 / 22:35
    0

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

        
    28.12.2015 / 12:49