Menu
Getting Started with AWS
Deploying a Web Application

Deploying a Web App Using Elastic Beanstalk

Using AWS, you can develop web apps quickly and then deploy them to a cloud environment that scales on demand. And with several AWS deployment services to choose from, you can create a deployment solution that gives you the right mix of automation and control.

In this tutorial, we'll assume that you're working on a new web app that isn't ready for production yet, but in the meantime you plan to deploy a small placeholder app that collects contact information from site visitors who sign up to hear more. The signup app will help you reach potential customers—people who might become early adopters or take part in a private beta test.

Here's a quick introduction to AWS Elastic Beanstalk and the other technologies we'll be using. (To dive right into the hands-on part of the tutorial, skip ahead to the next section.)

AWS Elastic Beanstalk

Elastic Beanstalk is a high-level deployment tool that helps you get an app from your desktop to the web in a matter of minutes. Elastic Beanstalk handles the details of your hosting environment—capacity provisioning, load balancing, scaling, and application health monitoring—so you don't have to.

Elastic Beanstalk supports apps developed in Java, PHP, .NET, Node.js, Python, and Ruby, as well as different container types for each language. A container defines the infrastructure and software stack to be used for a given environment. When you deploy your app, Elastic Beanstalk provisions one or more AWS resources, such as EC2 instances. The software stack that runs on your EC2 instances depends on the container type. For example, Elastic Beanstalk supports two container types for Node.js: a 32-bit Amazon Linux image and a 64-bit Amazon Linux image. Each runs a software stack tailored to hosting a Node.js app.

You can interact with Elastic Beanstalk by using the AWS Management Console, the AWS Command Line Interface (AWS CLI), or eb, a high-level CLI designed specifically for Elastic Beanstalk. For this tutorial, we'll use the AWS Management Console.

The Signup App

In this tutorial, we'll deploy an example app that lets customers submit contact information and express interest in a preview of a hypothetical web app that you're developing.

The app is built on Node.js, a platform that uses server-side JavaScript to build network applications. Node.js consists of a library and a runtime. The runtime is provided by the V8 JavaScript Engine.

Node.js is designed around a non-blocking, event-driven I/O model, which makes it useful for creating highly scalable web servers. Our app employs two external Node modules: Express, a web application framework, and Jade, a Node.js template engine that can be used to create HTML documents.

AWS provides a Node.js SDK, which helps take the complexity out of coding by providing JavaScript objects for AWS. We've used the Node.js SDK to build our sample application. To learn more about the Node.js SDK, see AWS SDK for JavaScript in Node.js.

To make our app look good, we use Bootstrap, a mobile-first front-end framework that started as a Twitter project.

Amazon DynamoDB

We'll use Amazon DynamoDB, a NoSQL database service, to store the contact information that users submit. DynamoDB is a schema-less database, so you need to specify only a primary key attribute. We'll use an email field as a key for our app.

Amazon Simple Notification Service

We want to be notified when customers submit a form, so we'll use Amazon Simple Notification Service (Amazon SNS), a push messaging service that can deliver notifications over various protocols. For our app, we'll push notifications to an email address.