Exclude environment variables?

I have a project with several lambdas in it. The main serverless config has multiple top-level environment variables defined under the “provider” element. It is standard serverless behavior for those env vars to cascade down to each lambda function which is, typically, the desired behavior.

However, I’m now writing a lambda that’ll be called by an existing CF distribution which (for some strange reason) can not have any env vars defined. Is there a way to disable this cascading behavior for just a single lambda?

For now, as a hacky workaround, I have a separate serverless config for just that one lambda but I don’t like it!

Thanks,
tim

lambda that’ll be called by an existing CF distribution

IMHO I think it’s better to separate Lambda@Edge functions to separate Serverless service, because of their special constraints - as you mentioned “for some strange reason can not have any env vars defined”

Yeah, it ended up working out better that way anyway since I ran into more restrictions (for example, edgelambda.amazonaws.com needed IAM service permissions).