How-To

Getting Started with AWS Elastic Beanstalk, Part 1: Hosting an App

Elastic Beanstalk lets you run cloud applications without worrying about the underlying infrastructure.

One of the big challenges that admins have always faced is that application workload demands change over time. As time goes on, demand for an application might increase or decrease, but the demand is unlikely to remain constant.

Back when all workloads ran on-premises, the solution to changing demand was usually to over-provision workloads with more resources than they actually needed. Although this approach was expensive and wasteful, it worked. Even so, over-provisioning should never be used in cloud environments where organizations are billed for the resources that they consume.

So what can you do when your workload demands change? In the case of simple workloads, such as those workloads that are based on a single EC2 instance, the solution is usually just to resize the workload. You might, for instance, increase or decrease the instance size based on the workload's current needs. One of the big problems with this approach, however, is that it isn't very practical for complex workloads that leverage several different services. After all, resizing such a workload would require you to not only resize all of the services used by the workload, but you would also have to make sure that the resizing was done in such a way that none of the services become a bottleneck and without accidentally over-provisioning any of the services.

A simpler solution to this problem is to use Amazon's Elastic Beanstalk. The idea behind Elastic Beanstalk is that it allows you to run your application without worrying about the underlying infrastructure. Elastic Beanstalk handles all of the sizing, health monitoring and all of the other tasks that go along with application hosting. By using Elastic Beanstalk, you are essentially treating your application as a managed service.

Now that I have spent some time talking about what Elastic Beanstalk is and why it is useful, I want to show you how to use it to host an application. Keep in mind that a real-life setup is likely going to differ from what I am about to show you, simply because every application is different.

Creating an Application in Elastic Beanstalk
To get started with Elastic Beanstalk, log in to the AWS console and open the Elastic Beanstalk service. When the Elastic Beanstalk screen appears, click on the Create Application button. This will take you to the Create a Web app screen, shown in Figure 1.

Figure 1: This is the interface used to create an application in Elastic Beanstalk.
[Click on image for larger view.] Figure 1:This is the interface used to create an application in Elastic Beanstalk.

The first step in creating an elastic beanstalk application is to provide an application name. Generally speaking, you can call the application anything you want so long as the name is less than 100 characters and you avoid using the forward slash.

Next, the interface gives you the option of assigning one or more tags to your application. This can be handy if your organization uses tagging, but the tags are completely optional.

The next thing that you will have to do is to specify the platform that your application uses. In other words, you are going to have to tell AWS what your application runs on. If for example, your application runs as a Docker container, then you would choose Docker as the platform. Of course, that is not to say that your application has to be containerized. Quite the contrary. There are currently 10 different application platforms to choose from. A few of the more popular choices include .NET (on Windows or Linux), Python, Java and Ruby. You can see the full list of platform choices in Figure 2.

Figure 2: This is the interface used to create an application in Elastic Beanstalk.
[Click on image for larger view.] Figure 2: There are 10 different application platforms to choose from.

Once you have chosen a platform, you will need to choose a platform branch. The platform branch is really just the platform version, although confusingly enough, there is another option called Platform Version. Suppose, for example, that you set the platform to .NET on Windows Server. The Platform Branch option would allow you to choose the versions of Windows Server and IIS that you want to use. You might, for example, choose Windows Server 2019, Windows Server 2016 or Windows Server 2012. You can choose between IIS 10.0 and IIS 8.5. The Platform Version option has nothing to do with the Windows Server or IIS version number, but rather is tied to Elastic Beanstalk.

The last step in setting up an application is to upload your code. If you are just trying to get a feel for how Elastic Beanstalk works, you can always choose the Sample Application option instead. Click the Create Application button to create the application.

Now that I have shown you how to create an Elastic Beanstalk application, I want to show you how to monitor the application's health and how to make changes to the application should it become necessary to do so. I will cover all that and more in the next part of this series.

About the Author

Brien Posey is a 22-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.

Featured

Subscribe on YouTube