Skip to content

000 django lambda

Alex Bradley edited this page Oct 20, 2020 · 4 revisions

Design for running a Django service on AWS Lambda

proposed

Context

AWS Lambda is being encouraged as the runtime for eRegs. Being a Django project, eRegs is typically run as a Python WSGI application.

Decision

https://www.serverless.com/blog/django-serverless-framework-a-match-made-in-heaven https://medium.com/@matias.forbord/starting-serverless-with-django-1b3dda1fb6a

service: cmcs-eregs

provider:
  name: aws
  runtime: python3.6

functions:
  reg_core:
    environment: ${self:custom}
    handler: handler.reg_core
    package:
      include:
        - /app/src/handler.py
    events:
      - http: ANY /
      - http: ANY {proxy+}
  reg_site:
    environment: ${self:custom}
    handler: handler.reg_site
    package:
      include:
        - /app/src/regulations/handler.py
    events:
      - http: ANY /
      - http: ANY {proxy+}

plugins:
  - serverless-python-requirements
  - serverless-wsgi
  • TODO: we need to show that we can do this with the existing programs.

Consequences

Requires wsgi.py files or equivalent for our systems.

Overview

Data

Features

Decisions

User research

Usability studies

Design

Development

Clone this wiki locally