vovantamvn / gs-beanstalk

A demo to deploy a Django app to Elastic Beanstalk.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting started with Django and AWS Elastic Beanstalk

Requirement

  • python3
  • pip3
  • virtualenv

Step 1: Clone and install dependencies

git clone https://github.com/vovantamvn/gs-beanstalk.git
cd gs-beanstalk
virtualenv venv
source ./venv/bin/activate
pip install -r requirements.txt

Step 2: Configure EB

Install awsebcli, in my case I install global

deactivate
pip install awsebcli

Step 3: Create an application

eb init
  • Select a default region: 7 (In my case I choose Singapore)
  • Enter aws-access-id & aws-secret-key: (You can see this article)
  • Enter Application Name:
  • Select a platform branch: 1 (It's recommended)
  • Do you wish to continue with CodeCommit? (Y/n): n
  • Do you want to set up SSH for your instances?: y (You can choose y to create a ssh key, and then you can access the instance.)

Step 4: Create an environment

eb create
  • Enter Environment Name:
  • Enter DNS CNAME prefix: (When you deploy an app to Elastic Beanstalk you will automatically get a domain name like xxx.elasticbeanstalk.com. DNS CNAME prefix is what you want to be used in place of xxx.)
  • Select a load balancer type: 2

Read my config in .ebextensions/django.config

Step 5: Terminate the environment

You can terminate the environment when you don't need it.

eb terminate

About

A demo to deploy a Django app to Elastic Beanstalk.


Languages

Language:Python 100.0%