Hey guys, I’m using `setDefaultFunctionProps` to c...
# help
a
Hey guys, I’m using
setDefaultFunctionProps
to configure Epsagon env-vars for all my functions. Now I want to setup one specific env-var called
EPSAGON_HANDLER
which should contain the path of my handler. Is there a way to “get” this value for each lambda using this function? Or should I set this env-var for each function individually?
f
Hey @Adrián Mouly, you might be able to use Aspect https://docs.aws.amazon.com/cdk/v2/guide/aspects.html#aspects_example
You can use this to look over all
lambda.Function
in ur app, and make changes to the underlying CloudFormation directly.
ie.
Copy code
if (node instanceof lambda.Function) {
  node.addEnvironment("EPSAGON_HANDLER", node.defaultChild.handler);
}
a
Interesting.