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

Provide function to execute when calling sls wsgi command #244

Open
estahn opened this issue Jul 3, 2023 · 0 comments
Open

Provide function to execute when calling sls wsgi command #244

estahn opened this issue Jul 3, 2023 · 0 comments

Comments

@estahn
Copy link

estahn commented Jul 3, 2023

We run django in AWS Lambda and want to apply database migrations via sls wsgi manage. The database user the application runs with is limited and not allowed to create/alter tables. Thus we want to define an alternate Lambda function with different environment variables providing database admin credentials. This is primarily a security concern to segregate the database base user the application uses from the database user the migration script uses.

findHandler currently returns the first function with condition handler: wsgi_handler.handler.

https://github.com/logandk/serverless-wsgi/blob/master/index.js#L436C7-L440

Instead of returning the first function, if --function / -f (required) is specified, the specified function should be used.

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

No branches or pull requests

2 participants