Skip to content

Simple demo of my AWS, Terraform, Docker, Python Django, and Angular skills

Notifications You must be signed in to change notification settings

dra11y/tower-jedi

Repository files navigation

Tower Jedi

Features

  • Angular CLI frontend
  • Plotly 3D Scatterplot used for game view
  • Terraform deployment to AWS
  • Django/PostgreSQL backend
  • Django Rest Framework
  • Client access to the Star Wars API (https://swapi.dev/api) to retrieve pilot names
  • Serverless PostgreSQL database on Amazon Aurora

Docker, PostgreSQL, and Terraform

This app is built on python:3.7-slim-buster with nginx and Django added to the installation (see Dockerfile). In development, a postgres:12.2-alpine image is used to host the database.

This app is currently configured to deploy to AWS with the following configuration:

AWS Diagram

Internet traffic arrives at the Application Load Balancer (ALB) and is forwarded to the EC2 instances via the Virtual Private Cloud (VPC). The EC2 application instances (2 by default) are managed by Amazon Elastic Container Service (ECS), which hosts a Docker repository of the application image within Elastic Container Repository (ECR). The database is using Amazon new serverless Aurora configuration with a PostgreSQL 10.7-compatible database backend that autoscales based on app demand. The app (in the EC2 containers) can access the public Internet (Star Wars API, etc.) through a NAT gateway.

Deployment

The configuration is managed by Terraform, which should be customized as follows:

  • In the terraform/ directory:
    • customize the variables.tf file
    • copy secrets.auto.tfvars.sample to secrets.auto.tfvars and customize
  • In the root (this) directory:
    • copy env.sample to .env and customize
    • review the Makefile (run make help in a terminal)
    • ensure Docker Desktop is installed and configured
    • in a terminal, run:
      • make install-prereqs to install terraform, node, and yarn
      • make build to build the Angular client and Docker image
      • For development:
        • make dev-client to build/watch Angular
        • docker-compose up in a new terminal to start up the dev containers
        • Visit http://localhost (as the nginx proxy server runs on port 80)
      • aws configure to setup AWS CLI -- use an IAM with sufficient account privileges to:
        • create/destroy EC2, ECS, Aurora, ALB, and gateway instances, and security groups...
        • setup CloudWatch logs...
        • basically, an AWS "superuser"
      • make plan to run terraform plan & check the configuration
      • make deploy to deploy to AWS
      • make open to open the latest deployed URL (the ALB URL on AWS)

About

Simple demo of my AWS, Terraform, Docker, Python Django, and Angular skills

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •