Deploy Applications Using Elastic Beanstalk

What Is Elastic Beanstalk?

Elastic Beanstalk makes it easy for us to quickly deploy and manage the applications without having much knowledge about Infrastructure services.

We just have to upload the code and Elastic beanstalk will automatically Scales , Monitors and Balances the Load depending on the application code.

Applications can be deployed into Elastic Beanstalk using one of the below methods.

  • Using AWS Console
  • Using EB CLI (a command line interface for deploying applications)

In this article , We will learn how to deploy applications using AWS Console.

Supported Languages:

Elastic Beanstalk supports the following applications.

  • PHP
  • Python
  • Java
  • Node.js
  • Ruby
  • Go
  • .NET

When deploying your code into Elastic Beanstalk you can choose any one of the above platform in which your application code is written.

Workflow

The Work flow of deploying applications into Elastic beanstalk is as follows:

  • We will create an application and upload the application source bundle
  • We will Configure environment such as Instance , Load Balancing , Auto Scaling
  • We will re-upload the code to the environment for new any changes in the code

Deploying Applications

Lets start by deploying sample application into Elastic Beanstalk ,

Login to AWS Console, Under Compute , Choose Elastic Beanstalk

Click Get started

Step 1 : Create A Web App

Here We will create a application and an environment for the application by choosing the platform and the sample application code.

Provide a name for the application

Under Base configuration

Choose the Application Platform , For this guide , We will deploy sample PHP Application.So Lets select PHP.

And the application code be Sample application.

Next Choose Configure more options

Step 2 : Configuring Environment

Here We will configure environment for our applications such as Instance , Security , Load Balancing , Monitoring ,Notification, Network and Database and much more.

It depends on How much resources a application needs.

You can either deploy an application in an single on-demand EC2 Instance or With High-Availability using Load Balancer , Else you can setup Custom Configuration.

Lets us deploy into Single EC2 Instance.

Under Instances , Click Modify ,

Here , You can configure the EBS Volume size , Type of EBS Volume.I am leaving it to default.

Next Under Capacity,

Environment Type , You can choose Single Instance or Load balanced as per your application needs.

You can change the Instance type here.

And you will see the AMI-ID mentioned there.If you are making any changes to your applications and you want to apply the same across your environment , You have to update with the Latest AMI ID and Restarting the applications will roll an update across the environments.

And I am leaving rest of the configurations to default.All the other configurations will be explained in detail in my upcoming articles.

Click Create app And you will see the console showing the process of environment creation.

It will create a Resources such as

EC2 Instance for hosting the Application , S3 Bucket for storing the Environment data , Security Group.

Once the Environment is Successfully created, You should see the Health be OK.

You will get an URL for this environment using which you can check the Application.

Conclusion

We have successfully deployed PHP Application into the Elastic Beanstalk environment. You can modify the environment anytime based on the requirements.

Thanks for reading this article , Hope you found it helpful.

Please do check out my other publications.