• us-flag+1-678-961-0916
  • inda-flag+91-484-486-0256

How To Deploy High Available application using Elastic Beanstalk

Introduction to Elastic beanstalk

Elastic Beanstalk is a orchestration service which uses platform-as-a-service model to integrate multiple AWS services for application deployment and management. The services that beanstalk integrates are EC2, S3, ELB with Auto-scaling,Cloudwatch .

Elastic Beanstalk supports Ruby, php , Python, .NET, Java, Node.js applications and Webservers such as Apache, IIS.  We have options to deploy project via Zip, WAR file, Docker and Git.

Elastic Beanstalk enables us to auto-scale, load-balance apllications for high traffic environment with minimum time.  It also allows us to view information like metrics, events, logs, health status etc

How to deploy HA  application using Beanstalk application?
Following steps discuss how to deploy applications using Elastic Beanstalk

Step I) Login to AWS console
Step II) Switch to Elastic Beanstalk Dashboard and  click on the link “Create New Application”

Step III) Follow the steps posted below.
III.1) Application Info:

To start with the creating Elastic Beanstalk , we need to set a name for Application that we intend to deploy.

 III.2) New Environment:

option 1) Web Server Environment
This options sets the Elastic Beanstalk application  on a single instance or a loadbalanced auto scaled instances

option 2) Worker Environment

This option is used where the operations take a long time to complete such as tasks for image/video processing, generating zipped archive, etc.  The worker tier do not directly respond http request.
Instead it offloads long-running processes from your web tier using SQS.
Here we use Webserver environment to demonstrate web application such as wordpress.

III.3) Environment Type:

Predefined configuration: select  php from the dropdown menu

Environment type:
option 1: Load-balancing, Autoscaling Environment
option 2: Single-instance Environment
III.4) Application Version

We have a few options here to upload the application. Either we can upload the application using
“Upload your own ”  or use S3 URL to get the uploaded application from the S3 bucket

In this case we are trying to upload a wordpress application .

Deployment Preferences

Deployment policy: This option controls how the deployment  is performed in the instances launched using auto scaling groups.

This comes handy when we update our application in batches so as to avoid downtime when deploying.

These are the options available in the deployment policy.

More details can be viewed at
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.rolling-version-deploy.html?icmpid=docs_elasticbeanstalk_console
III.5) Environment Info

Environment name: provide a environment name
Environment URL: A url will be generated in this field which is used for the accessing  the application . You can test the availability of the url generated using the “check availability” button.
Description:(optional)

III.6) Additional Resources

If you want to deploy the database of the application is RDS, select both the options as listed above.

III.7)  Configuration Details

Instance type: select the instance type you wish to create.
EC2 key pair: select the key pair you wish to set for the instances launched.

III.8) Environment Tags

Custom tags can be created to identify the instances launced.

III.9) RDS Configuration

Select the appropriate DB engine, DB engine version, Instance class, Allocated storage, Username, Password, Retention setting & Availability as we need

Check the AWS doc for more details on the RDS Configuration options.
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.db.html?icmpid=docs_elasticbeanstalk_console
III.10) VPC Configuration

Select the appropriate VPC,subnet and the security groups

More details on the VPC configuration options are available from the following link
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/vpc.html?icmpid=docs_elasticbeanstalk_console
III.11) Permissions

Select the appropriate instance profile and the service role.

III.12) Review Information

Check the information from the final page and select “Launch” button to launch the application using Elasticbeanstalk.

Step IV)

Once you have the application deployed , you will see following page in the Elastic Beanstalk Dashboard.

Select the environment name we have created earlier . This will load following page

You can click on the configuration page to customize the behaviour

The configuration page shows the current configuration of your environment and its resources, including EC2 instances, ELB, notifications and health monitoring settings. Use the settings on this page to customize the behaviour of your environment during deployments, enable additional features, and modify the instance type and other settings that you chose during environment creation. This will include tweaking autoscaling policies, Monitoring interval , environment type, auto-scaling policies like min/max instance count, availabilility zones, Scaling cooldown time , Scaling trigger & time based scaling, Deployment & Update policy . It also allows you to set set maintenance window for carrying out updates in a predefined time.

Step V)

Load the URL generated from the elastic beanstalk dashboard to load the application deployed.

This page displays the wordpress web application we have uploaded from the Elastic Beanstalk. The above installation wizard has to be continued to install wordpress.

Conclusion

We used wordpress installation to show how a php application can be deployed using HA options using Elastic Beanstalk. We can extend the same tutorials to deploy a variety of applications listed in the following links.

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.platforms.html
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html

About the author

admin