aws / aws/chalice

Add an on_start_event hook for connecting databases - stop the authorizer connecting to the database on launch

Open
#1,705 3 comments 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11.1k
Forks
1k
Avg merge
1d 22h
Merged PRs (30d)
2

Description

Using globals and then having if AWS_CHALICE_CLI_MODE to check whether we should connect to our database or not feels hacky. It would be very nice to have an on startup event hook so that we can add code such as connecting to our database / reporting etc. to the lambda start event.

Just a callback like:
```python
def on_server_startup():
startup_code()
```
would be amazing

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by tracing the launch path around the AWS_CHALICE_CLI_MODE check and the authorizer's database connection, then establish the startup hook's timing and expected behavior before defining completion with tests for callback execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
backend, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.