Regular AWS services publish events to invoke a Lambda function. It is also called a push model. A push model has the following behavioral characteristics:
- Regular AWS service resources maintain event source mappings with an event source. AWS provides APIs to manage event source mappings. For example, the S3 bucket notification configuration API enables us to configure an event source mapping on a bucket. This configuration mapping identifies the bucket event, which is published to a Lambda function that is configured on the bucket.
- As the event source invokes the Lambda function, it is essential to grant the necessary privileges to the resource, using a resource-based policy. This resource-based policy is referred to as a Lambda function policy.
Figure 17.2 explains how Amazon S3 pushes an event to invoke a Lambda function:
Figure 17.2...