Processing data with Lambda - Amazon Monitron

Amazon Monitron is no longer open to new customers. Existing customers can continue to use the service as normal. For capabilities similar to Amazon Monitron, see our blog post.

Processing data with Lambda

Step 1: Create the IAM role that gives your function permission to access AWS resources

  1. Open the roles page in the IAM console.

  2. Choose Create role.

  3. Create a role with the following properties.

    • Trusted entity: Lambda

    • Permissions: AWSLambdaKinesisExecutionRole (and AWSKeyManagementServicePowerUser if the Kinesis stream is encrypted)

    • Role name: lambda-kinesis-role

    IAM role creation interface showing name, review, and create steps with role details and permissions.

Step 2: Create the Lambda function

  1. Open the Functions page in the Lambda console.

  2. Choose Create function.

  3. Choose Use a blueprint.

  4. In the Blueprints search bar, search and choose kinesis-process-record (nodejs) or kinesis-process-record-python.

  5. Choose Configure.

    Create function interface with options to author from scratch, use a blueprint, or select container image.

Step 3: Configure the Lambda function

  1. Choose Function name

  2. Choose the role created in the first step as the Execution role.

  3. Configure Kinesis trigger.

    1. Choose your Kinesis stream.

    2. Click Create function.

    Lambda function configuration form with basic information and Kinesis trigger settings.

Step 4: Enable Kinesis trigger in AWS Lambda console

  1. On the Configuration tab, choose Triggers.

  2. Check the box next to the name of the Kinesis stream and choose Enable.

    Lambda function configuration page with Triggers tab and Kinesis stream trigger highlighted.

The blueprint used in this example only consumes log data from the selected stream. You can further edit Lambda function code later to complete a more complicated task.