DEV Community

Steve Pe for AWS Community Builders

Posted on

What is AWS Elastic Beanstalk and how to deploy simple HA web application

AWS elastic beanstalk (EB) is developer centric view of deploying an application using aws components like ec2, asg, elb, rds and etc. EB is free service and only pay for the underly infrastructure. Fast simple and customizable. EB support multiple languages like Go, Java, .Net, Node js, PHP, Python, Ruby and so on. It is aws fully managed service.

AWS Elastic Beanstalk
Before any eb deployment make sure create IAM role called aws-elasticbeanstalk-service-role with these eb policies:

  • AutoScalingFullAccess
  • ElasticLoadBalancingFullAccess
  • AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy

IAM Role Example

Here how to deploy sample web ha app using aws elastic beanstalk:

Go to AWS Elastic Beanstalk console: and click Create Application.

  • Give your application name at Application name area & choose the platform at platform section.

EB Sample App

  • In the Application code section you have to choose a sample application and the click on Configure more options

EB Sample App Configure

  • Select High Availability at Configuration Presets section area

EB Sample App HA Configure

  • At Capacity section click edit and enter desire number of instances at Auto Scaling Group and click Save at bottom.

EB Sample App ASG Configure

EB Sample App ASG Configure

  • At Network section click edit and choose VPC, Load balancer settings and Instance subnets and click Save. (Only of not using default VPC) this example is not using default VPC.

EB Network

EB LB setting

EB Subnets

  • At the Load balancer section and click Edit and select Application Load Balancer at Load balancer type area, then click Save at bottom.

EB Application LB

EB Application LB

  • At Security section click edit and enter "ec2 keypair" if require to login (ssh) to ec2 instances.

EB ec2 keypair

  • Finally, at Rolling updates and deployments section click edit and update desire update Deployment policy. Click Save at bottom.

EB update policy

EB update setting

  • After all configuration updates Click Create app at bottom.

EB create app

  • Here are events and at the end Green check mark with environment url.

EB deployment output

  • Environment overview page

EB environment overview page

Congratulations you are successfully deployed Web App using AWS Elastic Beanstalk!

Top comments (0)