aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.67k stars 1.01k forks source link

Updating a dynamic variable without having to re-deploy Chalice #2040

Open pchilst opened 1 year ago

pchilst commented 1 year ago

Hello,

My app has a subfolder from root directory (./chalicelib) where I have a local process running that updates a token value every 30 min to a flat file that gets read in my app.py. I'm finding when I deploy Chalice, it seems to send the folder with the token value over as static, so that the deployed app does not read the updated values I'm writing locally every 30 minutes.

I am wondering if there's any way I can pass these updated tokens to the deployed app without having to just keep re-deploying it every 30 mins?

Thanks

chreteitelbaum commented 1 year ago

A lambda function can only run 1 process. I would suggest splitting the token refresh process into another lambda that will store the token value in AWS Secrets Manager or some other datastore. Then retrieve that using the main lambda function.