django-lwa-cloudfront-apigw-tf.pat-dev.advancelocal.dev
django-lwa-cloudfront-apigw-tf
A Django app on Lambda through Lambda Web Adapter and gunicorn, from OpenTofu. CloudFront sends every request to a regional API Gateway custom domain, serves /static from S3, and caches /api/time for 5 seconds.
App
- Django, Python
- gunicorn
Runs on
- CloudFront
- origin access control for S3
- response headers policy
- S3
- API Gateway, regional
- custom domain
- API key
- Lambda, Python, with the Lambda Web Adapter layer
Foundation
- inf-baseline
- Wiz scanning
- Scheduled deploys and checks
Cache, live
Polling /api/time every second through CloudFront.
waiting for the first poll
CloudFront hittrip to the app
Django sees
request.get_host()- django-lwa-cloudfront-apigw-tf.pat-dev.advancelocal.dev
request.build_absolute_uri()- https://django-lwa-cloudfront-apigw-tf.pat-dev.advancelocal.dev/
reverse("result")- /result/