Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement][docs] aws lambda monolith (lambdalith) #1953

Open
Lewiscowles1986 opened this issue Jul 25, 2024 · 0 comments
Open

[enhancement][docs] aws lambda monolith (lambdalith) #1953

Lewiscowles1986 opened this issue Jul 25, 2024 · 0 comments

Comments

@Lewiscowles1986
Copy link

Description

It took me a very, very long time to work out why I could not use Connexion 3 with Flask in AWS Lambda #1807

While some of this may have been docs and other iterations, and workload related (I didn't try for months solid, more like an hour or two here, and there)

In case anyone is interested or would like docs

app.py

from connexion import FlaskApp

app = FlaskApp(__name__)

app.add_api("openapi.yaml")


def post_greeting(name: str):
    return f"Hello {name}", 200

lambda_handler.py

from app import app
from mangum import Mangum

lambda_handler = Mangum(app, lifespan="off")

Essentially, use Mangum man·gumm (not Magnum mag·nuhm) is the only thing you'll need. Prior we used some AWS to wsgi package, but Connexion 3 is essentially, always ASGI on the outside.

I Think this also helps if refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant