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

AWS Lambda (and / or other cloud vendor) example(s) of Connexion 3 #1936

Open
Lewiscowles1986 opened this issue May 29, 2024 · 1 comment
Open

Comments

@Lewiscowles1986
Copy link

Description

So since October 2023 we've had a desire to upgrade from connexion 2 to connexion 3 in AWS Lambda using the FlaskApp

I've opened another thread about issues encountered #1807

I Also have an example of the connexion quick-start in AWS Lambda

Expected behaviour

Easy setup, well-trodden path

Actual behaviour

Errors from libraries used within connexion (vendor dependencies)

Steps to reproduce

Minimal reproducible example
Archive 3.zip
Create a lambda, python 3.12 on ARM64; upload the zip

Building / iterating

pip install \
--platform manylinux2014_aarch64 \
--target=package \
--implementation cp \
--python-version 3.12 \
--only-binary=:all: --upgrade \
-r requirements.txt

requirements.txt:

connexion[swagger-ui,flask]==3.1.0
asgi_aws==2.0.0

Additional info:

Output of the commands:

  • python --version 3.12
  • pip show connexion | grep "^Version\:" 3.1.0

abersheeran/a2wsgi#56
yezz123/asgi-aws#25

Note: So one of the issues above; I think it's a2wsgi a connexion dependency is patched in the zip I've attached to overcome an issue with the body returning empty. I still need to experiment more to find if that is necesarry, rather than plain convenient.

The only reason I've not switched to FastAPI, which was very painless to setup is that with connexion, I author the OpenAPI and then the program fails if it does not comply; wherease with FastAPI; it seems the default is inverted. Low developer friction at the high-high cost of not knowing when things break for FastAPI users.

This project (Connexion) is amazing; I'm open to working harder on this problem, being course corrected with simpler approach and contributing bug fixes or docs to connexion or upstream repos.

Thank you

@Lewiscowles1986
Copy link
Author

Looks like mangum has a better ASGI lifecycle for managing Connexion apps. Just replaced asgi-aws with mangum, and things "Just work ™️"

I wonder if the team would be open to receiving an example or write-up?

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