Deploy a Production Application using PaaS Services on AWS

In this part of the project, we deploy an e-commerce demo application to production using Platform as a Service on AWS.

Approach

Our demo application provides a REST API and is written in Python using the Django REST Framework. The application is backed by a relational database for which we have chosen MySQL for the database server. Given these technology choices, we will need a web server, a database server, and appropriate connectivity between them.

Though the application in its current state is pretty simple, we won’t treat it as being so simple that we should use Amazon Lightsail to host the application. Rather, we will use Elastic Beanstalk to provision the production environment. By using Elastic Beanstalk, we have a clear path to expand the application with more server types (such as a cache server) at a later time.

Solution Features

The solution provided by this exercise has the following features:

  • Single instance configuration with database – no load balancer, no scale set, but does have reverse proxy server
  • Log streaming to S3 and CloudWatch
  • Environment variables for Django and database
  • EC2 Instances are small – t2.micro, t2.medium
  • Key pair for SSH access to web server later, if needed
  • Using account default VPC and subnets
  • Delete database when environment is terminated
  • Open TCP port 3306 to allow database setup

How Do The Pieces Fit Together?

The following diagram illustrates how the components of our deployment fit together:

Steps

Please follow these steps to complete the project:

  1. Provision an Elastic Beanstalk Environment
  2. Install Application Code and Populate the Production Database
  3. Tailor a Django Application for Deployment to Elastic Beanstalk
  4. Deploy a Django Application to Elastic Beanstalk
  5. Troubleshooting Your Elastic Beanstalk Deployment