AWS as a Software Development Platform

Keeping Up with the Times

Some tools are just fundamental to the development of any type of software such as version control and IDE's. In this post I'll give you an overview of the AWS tools that can be used for development. I'll show you how to use AWS CodeCommit for private git repos and even a full cycle of local commit to open internet deployment with a single click. Interested ? Check it out.

Github ... ain't nobody got time for that

Most developers are accustomed to Github as a remote repository for their Git repos. Aws has their own private and encrypted upstream repository called CodeCommit. You can push and pull via ssh just like Github but CodeCommit gives you access to Aws services as well as controlling who can access your code.

Git Access with CodeCommit

The setup for CodeCommit starts with IAM but is very similar to uploading ssh keys into Github. Let's start by making a new IAM user and assigning some permissions to push and pull code. First we create a new user

Now set his permissions.

Be sure that you take note of the new users access key and secret key so that you will be able to access Aws services programatically from the api. From the security credentials tab for the user you will be able to upload an ssh public key. While you are here be sure to generate and download https git credentials for CodeCommit. We'll use these later for git commits from Eclipse Oxygen. Here is what the whole thing looks like

Once you have uploaded your ssh key an ssh key id will be generated by Amazon. Now click on show ssh key and copy this to the keyboard. In the same directory where you generated your ssh key that you uploaded, create a file called aws-key and paste in what you have what you copied. You'll also need to create a config file and populate it with

Host git-codecommit.*  
  User your-ssh-key-id
    IdentityFile ~/.ssh/id_rsa

Now head over to CodeCommit in the console and create a repo. I've called mine JavaApp and I can now locally clone it with the command

git clone ssh://

If you have done it correctly the repo will clone just like it would from Github.

CodeStar and Eclipse

Many developers like to use Git from the command line. You can certainly do that with the setup I have just given you. However, your code will likely be written in an IDE and if you want to control Git from that IDE you can have that freedom also. Now that we have established local git connectivity let's make a full blown deployed app. Head over to CodeStar in the console and let's use an Aws template for a Java webapp deployed on ElasticBeanStalk.

Aws will now generate code and deploy via the ElasticBeanStalk service. If you head over to ElasticBeanStalk you'll see AWS has deployed your application to a url. Here is the default index.html.

IDE Integration with CodeCommit and ElasticBeanStalk

At this point Aws has auto generated application code that we can checkout via CodeCommit in Eclipse. For this tutorial I downloaded the latest version of Eclipse called Oxygen. From the Help menu in Eclipse you can access the Marketplace and download the Aws Toolkit. This gives smooth CodeStar Integration.

. When this completes you can import a CodeStar Project from the Aws menu bar here

Make a commit and Push to AWS

I'm just going to change the text on the default index.html to demonstrate a push and build in ElasticBeanStalk. The Aws Toolkit will setup the git integration for you, so if you select your project in the project explorer shift+ctrl+# will pull up your commit menu where you can commit and push straight to Aws.

After your commit ElasticBeanStalk will automatically detect it. The code will be built and deployed to the application server. We can see that our commit worked successfully below

Wait There's More!

There is plenty more that you can do with the infrastructure that we have laid out here. The CodeStar Service even facilitates Jira integration and makes it unbelievably simple to forklift your whole development team into the Aws environment. There are even more services like CodeBuild for building and testing. Also CodeDeploy is a free service for continuous integration. CodeDeploy even has autoscaling integration that gives a self healing quality and and high availability. A big question is where does this leave traditional tools like Jenkins and Github? Only time will tell, but it's hard to argue with this level of sophistication and integration.