Russell
Russell

Reputation: 2076

Developing AWS applications behind an authenticated HTTP proxy

We have to develop an application that will be deployed on AWS EC2. As part of our nightly build we would like to unit test our code locally then deploy to an AWS instance and run functional tests over the internet.

In an ideal world we would simply write a build script to use the AWS SDK to pick a suitable AMI, start an instance, login with SSH, set up the environment, FTP our program across and Bingo! However we are behind an HTTP proxy. Since we can't use SSH or FTP we've thought of three basic options.

1: Try to add userData to our RunInstanceRequest that would cause the instance to set up our environment, download and run our program (perhaps from an AWS S3 bucket) as it starts. In Java this would be something like:

RunInstancesRequest runInstancesRequest = new RunInstancesRequest()
    .withInstanceType(myType)
    .withImageId(id)
    .withMinCount(min)
    .withMaxCount(max)
    .withSecurityGroupIds(mySecurityGroup)
    .withKeyName(someKey)
    .withUserData(myScript); //add our installation script

RunInstancesResult runInstances = ec2.runInstances(runInstancesRequest);

2: Install our program on a VM locally and import the whole VM to AWS using the ec2-import-instance tool as described here.

3: Jump up and down and demand a less restrictive networking environment.

We feel uneasy about (1) as it will be very difficult to debug any problems with the installation. (2) involves the transfer and conversion of a whole VM every time we deploy and (3) doesn't look promising!

Does anyone know the best way to do this?

:D

Upvotes: 0

Views: 398

Answers (1)

jamieb
jamieb

Reputation: 10033

Why don't you build your own custom AMI that automatically downloads and executes a remote installation script at boot? You can either write a fancy init.d script or call a simple shell script from /etc/rc.local (assuming a Redhat-like disto). This is very similar to how RightScale does things.

Upvotes: 1

Related Questions