In this video, discover how EB automates many of the previous steps and offers pre-provisioned stacks. Additionally, explore some EB key concepts.
- [Instructor] Elastic Beanstalk is AWS's application platform as a service. Before we delve into platform as a service though it might help to take one step back and understand infrastructure as a service. Infrastructure as a service platforms like AWS give you the tools to easily create and manage many components of a data center that would formerly have involved manual effort and physical hardware. AWS has several great examples of infrastructure as a service. Think of all the details that AWS takes care of when you build a VPC subnet, EC2 instances, load balancers, or security groups.
You don't need to know how to install, deploy, or scale a load balancer. AWS abstracts that complexity and frees you up to spend time on higher level problems such as how you want to architect your systems. Platform as a service takes things a step further. As a web developer you may be familiar with the many steps it takes to get an application server up and running. But with platform as a service those details are handled for you. All you need to care about is developing your app and pushing it to the platform. Elastic Beanstalk offers platform as a service for web applications, using many popular languages, letting you focus on your application.
It gives you all the tools you need to deploy, run, and scale your app with minimal intervention, while still giving you the flexibility to configure the environment as needed. Elastic Beanstalk provides this capability for many popular web programming languages such as Ruby on Rails, Python, Node.js, PHP, Go, Java, and .NET. Let's look at what it takes to get a typical end tier web app deployed to the world. Users connect to a domain name that points to a web application server. The application needs a data storage.
So there's a database instance. It could be MySQL, PostgreSQL or something else. Of course we have to prepare for loader in our application. So we want to load balance it across multiple hosts. So we introduce another app server turning our single app server into a layer of multiple app servers. We then introduce a load balancer to distribute the user traffic across these hosts. That's not all. Let's zoom in on the app server because we need to do some provisioning. Often a web server runs both an application server and a web server, which proxies requests to the app server.
Although I should note that in some cases you may actually break the web server app into it's own tier, on it's own hosts so that the web server can scale independently of the application server. My preferred Ruby on Rails app stack starts with NGINX, which serves static content and proxies all other requests to a Rails app server. And to actually run the app I'll need an up to date version of Ruby along with Bundler, the RubyGems package manager. Good news, Beanstalk will take care of all of this for us. Load balancing, web server provisioning, databases, and more.
So let's look at the components of an Elastic Beanstalk deployment. The first step is to define an application. An app has a name and an associated stack. In Beanstalk terms, a stack is the choice of language version in the application server you wish to use. After that we define environments. Environments are just what you might expect. Definitions of environments such as development or production. Later we'll deploy application revisions to these environments using the AWS console or the Elastic Beanstalk command line tools.
And even as Beanstalk enables us to forget about the details of both infrastructure and platform, it still gives us flexibility in how to run the application. For instance, we can choose among several combinations of Ruby versions, application server, and operating system. These combinations are called stacks. And you'll find a choice of stack for every web application platform that Beanstalk supports. The environment creation step is where Elastic Beanstalk creates everything you need to get started deploying. First it creates an auto scaling group indicated by the black dashed line here.
That auto scaling group is associated with an elastic load balancer, shown here. The load balancer can be paired with an SSL certificate to serve HTTPS traffic. The auto scaling group starts with a default size of one. So you get an EC2 instance here. That instance will be automatically provisioned with the software required by your selected platform and stack. In the Ruby example this host is an Amazon Linux instance with Ruby and NGINX installed. That host also has an agent running, shown here. The agent enables detailed monitoring of your environment.
You can optionally ask Beanstalk to create an RDS database for your app, shown here. Each component, the ASG, EOB, and RDS database is protected by a security group. The rules differ by component but for example the EOB group allows port A traffic by default. Finally, AWS uses route 53 to point a DNS name to the ELB. Just like that, Beanstalk takes a ton of work off our hands. We instantly have the infrastructure we need plus server instances, provisioned with the required software already installed and configured.
We also get management of load balancing and SSL. Beanstalk can deploy applications stored in S3 or in a Git remote such as GitHub, Bitbucket, or AWS's own CodeCommit. The Beanstalk CLI is a command line interface that can perform all environment creation and management tasks. It can also deploy and update applications. Additional features of Elastic Beanstalk include, enhanced health checks and environment monitoring. If you'd like to explore more about Beanstalk you can look into worker tiers, which are applications deployed that do not have a web interface.
And container based deployments which use docker containers. Also, if you're a Java developer or a .NET developer, search the AWS docs for details on plug ins for Eclipse or Visual Studio that add integrated Beanstalk deployment tools to the native experience.
Released
12/24/2018- Understanding AWS EC2
- Creating an EC2 instance
- Provisioning with CloudFormation
- Architecting apps for horizontal scaling
- Creating an Elastic Beanstalk environment and app
- Using OpsWorks
- Deploying apps with CodeDeploy
- Working with the Cloud9 cloud-based IDE
- Quickly setting up coding projects with CodeStar
Share this video
Embed this video
Video: Understand Elastic Beanstalk