Hi Django Forum,
I’d like to share an article I wrote (and accompanying GitLab repo) that covers my experience using the AWS Cloud Development Kit (CDK) to build a Django application.
CDK is a powerful abstraction over CloudFormation and it is available in a number of languages (I’m using Python, of course!) It not only helps you define AWS infrastructure, but it can also build and publish container images, push files to S3 and makes working with Lambda functions very easy. I struggled with writing CloudFormation, but this tool has removed a lot of the friction and I have been having a lot of fun with it. Is anyone else here using CDK? I would love for any feedback on my article or project if anyone has time to take a look, thank you!
Here are some of the AWS products I’m using in my CDK/Django (+ Vue.js) project:
- Route53 hosted zone + ACM
- CloudFront with 3 origin configs: ALB (for Django API), S3 Website (for static Vue.js site), S3 Origin for Django assets
- Aurora Postgres Serverless database
- Fargate for running containerized Django workloads (gunicorn/REST Framework API, Django Channels, Celery, management commands, etc.)
- Autoscaling celery workers with custom CloudWatch metrics and Lambda function (including scaling all the way down to zero during inactivity, configurable per celery queue)
I’m using AWS CDK in a GitLab CI pipeline to practice Infrastructure as Code/GitOps.