Lambda functions support the environment parameter and make it easy to define a key-value pair. But what about getting an object (defined by a module variable eg) into the function's environment?
Quick example of what I'm trying to accomplish in python 3.7:
Terraform:
# variable definition
variable foo {
type = map(any)
default = {
a = "b"
c = "d"
}
}
resource "aws_lambda_function" "lambda" {
.
.
.
environment {
foo = jsonencode(foo)
}
}
and then in my function:
def bar:
for k in os.environ["foo"]:
print(k)
Thanks !