Can lambda's Environment variables store a list/array? I have a lambda which require some email ids(stored as list) which I am trying to pass through environment vars. Can this be done or is it not allowed?
list_email=['[email protected]', '[email protected]']
I have to get this list from terraform code so i can't directly call it in python code. So that is why I am trying to pass it in as an env var.
CodePudding user response:
Terraform has a jsonencode function, which "encodes a given value to a string using JSON syntax".
Set the stringified version as the lambda env var, then parse it back to a list using Python.