People getting started with cloud computing often ask me which AWS service they should use to deploy their applications on the cloud.

There is no simple answer.  The best choice always depends on the variables — but you probably knew that already.

In this article, I will describe the main considerations that you need to be aware of prior to moving to the cloud (or not moving at all).  Then we will dive into the AWS field by exploring the main features, and most common use cases for the following services: EC2, ECS, CodeDeploy, OpsWorks, and Elastic Beanstalk. We’ll explore which AWS service best meets your needs.

Why the Cloud?

In a traditional scenario, you usually would have a pre-defined amount of resources available for your applications pool. To provision the right amount of resources you need to predict and purchase hardware/software assets capable of handling your applications in maximum load. However, you will only need 100% of your resources for very short periods of time. After these peaks, some of your resources will be idle.

The obvious and painful problem is, that when part of your infrastructure is idle, you still pay for it. Even worse, you need to manage the whole thing all the time.  Also, some resources eventually break down, whether used or not, and you will be responsible for repair and maintenance.

I believe one of the greatest advantages of the cloud is control over the ability to consume resources in ways you want. Very likely money will be saved in the process.

Which AWS Service to use: moving to the AWS cloud

AWS has 50+ services and this array of options might not be simple for beginners to select the best option. In the next sentences, I will present you the most common AWS services to that you can use to deploy your applications. I include consideration for such things as main features, use cases, elasticity, scalability, manageability, and complexity.

EC2

EC2 stands for Elastic Compute Cloud and is the most basic compute service that AWS provides. Using EC2,  you can create virtual machines, called instances, where you can deploy basically any kind of application, and use any deployment tools available (e.g. Jenkins, Vagrant, Chef, Puppet, Docker, etc.), with a few limitations.

which AWS service

Since EC2 is highly flexible, and you have full control over your instances, AWS assumes you’ll also be taking care of all the management tasks and some security responsibilities.  That might be everything that you want, but this solution may be a bit complex and time-consuming. In order to achieve elasticity and scalability in your applications, you would need to configure or automate many things, including tools such as Auto Scaling and ELB (or develop custom tools) on your own. That probably is not what most people are looking for when they move to AWS.

ECS

ECS stands for EC2 Container Service and as you can probably guess, will run on top of the EC2 service. This service was specifically designed to deploy Docker containers in the AWS cloud. ECS makes
it possible to deploy Docker containers in a simple way, and AWS will handle the deployment and allocation of your containers inside your EC2 instances. With ECS you can define Clusters of Instance Containers and Create tasks. Very handy.

which AWS service

The greatest advantages of ECS is that it uses the images available in the Docker Hub and is easy to integrate with tools such as Elastic Load Balancer (ELB) and Auto Scaling (AS). There is no need to write custom scripts to manage scalability and elasticity because AWS provides this out of the box. Additionally, it is easy to achieve High Availability by using a Multi Availability Zone deployment.  You simply specify the proper configuration options for this and AWS will take care of the rest. Even better, this service is free of charge! You only pay for the resources that you will be using (e.g. EC2 and ELB) and nothing more.

If you want to easily deploy a container application and have your entire infrastructure described in your code, you’ll probably find this service the right fit for your application.

OpsWorks

OpsWorks is a service that helps you manage your infrastructure by using Chef recipes. Using OpsWorks you can easily create a stack and define layers for your applications, grouping the relevant pieces of your applications together. Doing this, you can have an application layer and a database layer, and manage everything in a single place.

which AWS serviceYou can choose between starting your application from scratch on OpsWorks or you can add existing resources to it. OpsWorks easily integrates with AWS’ services, and works with both EC2 instances or on-premises machines running either Linux or Windows.  To do this, install the OpsWorks agent in the machines that you want to use.

OpsWorks is great for managing web applications and for managing  large fleets of servers. The servers can be running enterprise solutions (for example), since you will be using a single point of management and applying changes to your servers via Chef recipes, it will be easy to maintain, operate, and test your deployments.

Which AWS service should you use? If you are planning to use this service with only AWS resources the service will be free. You will only pay for the resources that you use.

If you want to manage your application using Chef recipes, you’ll enjoy the freedom of choosing any operating system, and easily integrating your stacks with ELB, AS or Relational Database Service (RDS). This is the optimal service for your application.

CodeDeploy

CodeDeploy is a service that helps you automate your software deployments. This service offers you the opportunity of deploying new versions of your software using either EC2 instances or on-premises machines. To get started with the service you need to configure a new application in CodeDeploy and specify some Deployment Groups  (e.g. Dev, Test, Prod), in your machines you will have to install the CodeDeploy agent, configure some tags and grant it some Identity and Access Management (IAM) permissions.which AWS service

With CodeDeploy you are free to use Windows or Linux as your operating system. You are also free to specify your deployment scripts with the language you choose, as long as the machine that is running the code is able to execute it. You will still need to add in your code a YAML file called AppSpec file. You will also need the deployment scripts that you want to use. This service has some cool features out of the box, such as integration with AS and ELB for zero downtime deployments. As with OpsWorks, this service is free when you use it with EC2 instances. Otherwise, you pay a small amount for each on-premises machine.

Which AWS service should you use? You should consider this service if you want to automate your deployments without having to master tools such as Chef or different scripting languages. You’ll enjoy the ability to integrate CodeDeploy with many third party services/tools by adding CodePipleline in the mix, as we demonstrate in the AWS Developer Fundamentals course.

Elastic Beanstalk

If you have read this post so far and have no idea what AS, ELB, RDS mean in a practical/technical way, then Elastic Beanstalk is the right service for you. With Elastic Beanstalk, you can easily jump in with AWS and deploy web applications in a few minutes using Java, .NET, PHP, Node.js, Python, Ruby, Go, or Docker

which AWS serviceElastic Beanstalk will automate almost everything for you. It will manage AS, ELB, and configure your RDS instances. AWS has designed Elastic Beanstalk to be as simple as possible. You simply create an Application inside of it and create as many Environments as you want. It is also worth noting that Elastic Beanstalk integrates well with CodePipeline for continuos delivery.

Which AWS service should you use? If you just want to deploy your applications using AWS and don’t want to worry about elasticity, scalability, and all the management tasks that you would normally to perform, This is your service. Again, like the others, this service is free. You pay for the AWS resources that you use.

Conclusion

When someone enters a supermarket in search of a box of breakfast cereal he/she is often blinded by the unmanageable and uncurated selection. Do you want hot or cold, what flavor, what kind of nutrition, wheat, rye, etc. Not wanting to engage in a research project people often default to what they know to the detriment of what they might gain. I have selected a curated group of AWS services that should serve to bring clarity. There are many more services with a plethora of features. Over time, you might shift from one to the other as your need changes. The important part is getting started with something new that will make your life and work better.

I hope you enjoyed reviewing these AWS Services with me and that you’ll comment below if you want to add to the discussion.