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.
Before any eb deployment make sure create IAM role called aws-elasticbeanstalk-service-role with these eb policies:
- AutoScalingFullAccess
- ElasticLoadBalancingFullAccess
- AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy
Here how to deploy sample web ha app using aws elastic beanstalk:
Go to AWS Elastic Beanstalk console: https://console.aws.amazon.com/elasticbeanstalk and click Create Application.
- Give your application name at Application name area & choose the platform at platform section.
- In the Application code section you have to choose a sample application and the click on Configure more options
- Select High Availability at Configuration Presets section area
- At Capacity section click edit and enter desire number of instances at Auto Scaling Group and click Save at bottom.
- 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.
- At the Load balancer section and click Edit and select Application Load Balancer at Load balancer type area, then click Save at bottom.
- At Security section click edit and enter "ec2 keypair" if require to login (ssh) to ec2 instances.
- Finally, at Rolling updates and deployments section click edit and update desire update Deployment policy. Click Save at bottom.
- After all configuration updates Click Create app at bottom.
- Here are events and at the end Green check mark with environment url.
- Environment overview page
Congratulations you are successfully deployed Web App using AWS Elastic Beanstalk!
Top comments (0)