Install Chocolatey in Amazon AWS Instances

Chocolatey (https://chocolatey.org) is a package manager for Windows (similar to Yum/Apt-Get in Linux) based on NuGet.

Chocolatey is very useful to automate the deployment of Windows applications on the cloud.

We can use AWS instance bootstrap (aka User Data) to install Chocolatey and some applications on our AWS Instances.

Create a PowerShell Script

First we need to create a .ps1 file to install Chocolatey.

The example below will download and install Chocolatey first and then use Chocolatey to install SQL Server 2012 Express

Bootstrap a Chocolatey script from the AWS Management Console

In the step 3 (configure instance), expand the Advanced Details section.

Click as file option and use the Browse button to select the PowerShell Script.

Bootstrap a Chocolatey script from the AWS EC2 CLI

Open the AWS EC2 CLI console and type:

ec2-run-instances ami-69ae251e -n1 -k AWS-KopiCloud -g sg-b4016ed1 –instance-type t2.micro –subnet sunet-ad8b5ada –user-data-file D:ec2-api-toolsChocolatey-SQl.ps1

The User-Data-File parameter is bootstrap the PowerShell script on the start up of the AWS instance.

If the execution is successful, you will got the AWS Instance ID and more data such IP Address.

More info about parameters and output at

http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-RunInstances.html

Welcome to KopiCloud

KopiCloud is a blog about Windows and Citrix Automation on the Cloud.

Also, KopiCloud are tools under development to deploy Windows and Citrix servers on multi-cloud environments with few clicks and no code.

This blog is curated by Guillermo Musumeci, Founder and Chief Developer of KopiCloud and CtxAdmTools, a popular site for Windows and Citrix Automation Tools.

Here we will talk about deployment and automation on the Cloud (Amazon AWS, Microsoft Azure and Google Cloud) of Windows and Citrix servers.

Follow us on Twitter @kopicloud to stay tuned of new posts!

Thank you!

Guillermo Musumeci