Pass API Key to Lambda Function

Hey all,

I’m trying to create a private API using API key generated by API Gateway. Is there a way to pass the newly generated key directly into my Lambda function in the same serverless.yml file without any manual intervention?

I can’t seem to find an example of how to reference the key itself.

For reference, I’m looking at this example https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#setting-api-keys-for-your-rest-api