First Check
Commit to Help
Example Code
database: str = typer.Option(
...,
help="URL for Postgres sync database (e.g. postgresqlext://user:pw@localhost/mydb)",
envvar="SYNC_DATABASE",
)
Description
I havr a main() method with a parameter database as documented above. It will pick up its configuration from the given environment variable SYNC_DATABASE. This works perfectly from the commandline.
Now, I want to use the same application code with main() as entry point from within an AWS Lambda function.
The related environment variable is correctly set through the AWS Lambda environment (checked by using logger messages).
So SYNC_DATABASE is correctly available for the Python process.
The Lambda handler invokes typer.run(main).
However, the database parameter is always set to OptionInfo rather than the value of the configured environment variable.
Expected behavior: database should have the value of the env var SYNC_DATABASE.
Operating System
Linux
Operating System Details
AWS Lambda
Typer Version
0.4.2
Python Version
3.9
Additional Context
No response
First Check
Commit to Help
Example Code
Description
I havr a
main()method with a parameterdatabaseas documented above. It will pick up its configuration from the given environment variableSYNC_DATABASE. This works perfectly from the commandline.Now, I want to use the same application code with
main()as entry point from within an AWS Lambda function.The related environment variable is correctly set through the AWS Lambda environment (checked by using logger messages).
So
SYNC_DATABASEis correctly available for the Python process.The Lambda handler invokes
typer.run(main).However, the
databaseparameter is always set toOptionInforather than the value of the configured environment variable.Expected behavior:
databaseshould have the value of the env varSYNC_DATABASE.Operating System
Linux
Operating System Details
AWS Lambda
Typer Version
0.4.2
Python Version
3.9
Additional Context
No response