All Projects → briancaffey → django-cdk

briancaffey / django-cdk

Licence: Apache-2.0 license
A CDK library that provides high-level constructs for hosting Django applications on AWS

Programming Languages

typescript
32286 projects
python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to django-cdk

Containers Roadmap
This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
Stars: ✭ 4,132 (+13229.03%)
Mutual labels:  ecs, eks
terraform-modules
Terraform Modules by Peak
Stars: ✭ 16 (-48.39%)
Mutual labels:  infrastructure-as-code, eks
cdk-examples
AWS CDK Examples Repository
Stars: ✭ 49 (+58.06%)
Mutual labels:  cdk, eks
aws-ecs-devops-using-aws-cdk
This repository provides a general DevOps practices such MSA, IaC, CICD and Monitoring. AWS various services are used to provide DevOps best practices.
Stars: ✭ 110 (+254.84%)
Mutual labels:  ecs, cdk
eks-deep-dive-2019
Amazon EKS Deep Dive 2019
Stars: ✭ 61 (+96.77%)
Mutual labels:  eks
oneview-golang
Golang bindings for OneView api's
Stars: ✭ 22 (-29.03%)
Mutual labels:  infrastructure-as-code
imgui entt entity editor
A drop-in entity editor for EnTT with Dear ImGui
Stars: ✭ 146 (+370.97%)
Mutual labels:  ecs
ddd-practitioners-ref
EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.
Stars: ✭ 276 (+790.32%)
Mutual labels:  ecs
ecs-ssh
Tool that shows you cluster, services, and tasks to SSH into a container instance
Stars: ✭ 43 (+38.71%)
Mutual labels:  ecs
ecs
🐰 Entity Component System
Stars: ✭ 62 (+100%)
Mutual labels:  ecs
aws-usage-queries
This application bootstraps everything needed to query the AWS Cost and Usage reports through Amazon Athena. It also includes reference data and preconfigured SQL queries.
Stars: ✭ 28 (-9.68%)
Mutual labels:  cdk
eks-cluster
Quickly spin up an AWS EKS Kubernetes cluster using AWS CloudFormation
Stars: ✭ 41 (+32.26%)
Mutual labels:  eks
cdk-multi-profile-plugin
Adds multi profile/account, mfa and aws sso support to cdk apps
Stars: ✭ 41 (+32.26%)
Mutual labels:  cdk
devops-tf-eks
terraform baked AWS kubernetes cluster (EKS) - 1.18 compatible
Stars: ✭ 16 (-48.39%)
Mutual labels:  eks
cdk-github-actions-runner
Deploy self-hosted GitHub Actions runner to AWS Fargate using AWS Cloud Development Kit (CDK)
Stars: ✭ 89 (+187.1%)
Mutual labels:  cdk
eks-distro-build-tooling
This repository contains tooling used to build the EKS Distro, and all the projects contained in https://github.com/aws/eks-distro.
Stars: ✭ 55 (+77.42%)
Mutual labels:  eks
fabula
Minimalist server scripts.
Stars: ✭ 53 (+70.97%)
Mutual labels:  infrastructure-as-code
gocs
GameObject Component System for Unity
Stars: ✭ 102 (+229.03%)
Mutual labels:  ecs
terraform-aws-concourse
Terraform Module for a distributed concourse cluster on AWS
Stars: ✭ 12 (-61.29%)
Mutual labels:  infrastructure-as-code
rds-snapshot-export-to-s3-pipeline
RDS Snapshot Export to S3 Pipeline
Stars: ✭ 88 (+183.87%)
Mutual labels:  cdk

Django CDK

About this construct library

django-cdk is a construct library for AWS Cloud Development Kit (CDK) that I wrote to learn more about infrastructure as code. It it focuses on showing how to build AWS infrastructure to support Django applications. I recommend that you only use this construct library as a reference for your own applications.

There are four major constructs in this library:

  • ad hoc base
  • ad hoc app
  • prod base
  • prod app

Ad hoc environments (or on-demand environments) are application environments that teams use internally for testing, QA, internal demos, etc. Multiple ad hoc environments build on top of a single "an hoc base" environment that provides shared resources such as:

  • VPC
  • security groups
  • IAM roles
  • Load balancer
  • RDS instance

The ad hoc environments themselves consist of :

  • ECS cluster
  • task definitions
  • ECS services
  • Route 53 record
  • target groups
  • listener rules

I wrote about ad hoc environments in an article on my blog here: https://briancaffey.github.io/2022/03/27/ad-hoc-developer-environments-for-django-with-aws-ecs-terraform-and-github-actions.

The prod base and prod app constructs are used for setting up infrastructure for production environments.

I have written a very similar library that will deploy almost the exact same infrastructure (both for ad hoc and production environments) using Terraform which can be found here: https://github.com/briancaffey/terraform-aws-django. The directory structures for these two repositories are very similar. django-cdk is published to npm and terraform-aws-django is published to the Terraform registry.

This construct library focuses on security, best practices, scalability, flexibility and cost-efficiency.

Companion Django application

I developed this construct library together with a sample reference Django application that I wrote for learning, testing and experimentation. This Django application is a simple blogging application called μblog. This repo for μblog can be found here: https://github.com/briancaffey/django-step-by-step.

This repo shows how to set up local development environments using docker and docker-compose, and also contains multiple GitHub Actions workflows that demonstrate how to use django-cdk to build and deploy the applications using CI/CD automation. There are GitHub Actions workflows for both django-cdk and terraform-aws-django.

Important points

Here are some highlights of the features of this library:

Serverless infrastructure, containerized application

The Django application is packaged into a docker container and runs on ECS Fargate, a serverless runtime that abstracts the operating system. This gives up our control over the underlying operating system that runs our application's containers, but it also enforces best practices for security and scalability.

Access patterns

This application demonstrates how development teams can access both the application server and the database using AWS Systems Manager (SSM). This removes the need to manage overhead associated with SSH and allows for access to be controlled through IAM roles.

This follows AWS best practices for access patterns. EcsExec can be used in production for "break glass" scenarios where engineers may need to open an interactive shell that provides access to the application.

Port forwarding patterns are demonstrated to show how tools like DBeaver can be used to directly connect to the database over a secure Bastion Host placed in a private subnet.

Scalability

This construct library demonstrates how to apply autoscaling to our ECS services so we that we can scale in and out horizontally as needed by adding or removing instances in response to load on our application.

Safe Operations

Another major focus of this project is to show best practices for secure and safe application operations and change management. This includes patterns for safely rolling out both infrastructure updates and application updates with zero downtime.

Cost efficiency

The production environment is quite expensive to run compared to other alternatives, so it may not be a best fit for all organizations and development teams. ECS Fargate is more expensive for comparable amounts of compute that be purchased using EC2 instances.

Ad hoc environments take advantage of Fargate Spot instances which are less expensive than regular Fargate instances. Similar to EC2 spot instances, this allows us to use "left-over" compute resources at a discount with the caveat that the instances may be shut down for rescheduling by AWS at any time (with a 2 minute warning).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].