i was wondering if someone can help me here. I am devleoping a python SAM application in which i need to use environment variables. at the moment i am declaring my variables in template.yaml
Globals:
Function:
Timeout: 3
Environment:
Variables:
FMPREPKEY: <myfmprepkey>
However, given my project is on github, i'd rather put a placeholder in the yaml and 'override' the value somehow at runtime How can i do that?
Kind regards Marco
Environment variables are fixed and predefined at config. What you're looking for is basically invoking the lambda with your variables passed in as InvokeInput object, and then make use of this data inside your application.
example from AWS (https://docs.aws.amazon.com/code-library/latest/ug/python_3_lambda_code_examples.html):
Your function_params would be an object that you'd dynamically set and pass into the function at runtime. Then you can access that object inside lambda by referring to the event object.
Hope this helps.