concept AWS KMS in category aws

This is an excerpt from Manning's book AWS Lambda in Action: Event-driven serverless applications.
The idea is to wrap the whole logic of your Lambda functions in an internal function in your code. For example, you can call this internal function processEvent (figure 16.1). When the Lambda function is invoked, it checks whether the secrets have already been decrypted by a previous execution of the function. If yes, the process-Event function is called. If no, AWS KMS is (asynchronously) called to decrypt the secrets, and the process-Event is returned as a callback to be invoked as soon as the KMS decrypt call returns successfully.
You can now include the GitHub SDKs in your Lambda function and use the token to authenticate your calls. For additional security, you can protect the token using AWS KMS as described at the beginning of this chapter. For an overview of the available GitHub SDKs and the supported platforms, see https://developer.github.com/libraries/.