question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[aws-lambda] Add "Topics" property to EventSourceMappingOptions

See original GitHub issue

Lambda recently added support for MSK as an event source (https://aws.amazon.com/about-aws/whats-new/2020/08/aws-lambda-now-supports-amazon-managed-streaming-for-apache-kafka-as-an-event-source/), and there’s now a “Topics” property on the CloudFormation resource definition (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-topics).

Use Case

Using Lambda simplifies reading data from Apache Kafka, as other options usually require customers to worry about infrastructure management.

Proposed Solution

Include topics as an optional parameter of EventSourceMappingOptions interface:

export interface EventSourceMappingOptions {
    /**
     * existing properties
     */

    /**
     * The name of the Kafka topic.
     * 
     * Valid range:
     * * Maximum value of 1 
     */
    readonly topics?: string[];
}

It’d then be used as:

lambdaFn.addEventSourceMapping('MSKTrigger', {
    eventSourceArn: 'arn:aws:kafka:us-east-1:123456789012:cluster/kafka-cluster/random-id',
    startingPosition: lambda.StartingPosition.LATEST,
    topics: ['my-topic']
});

Other

In the future, there could even be a MSKEventSource in the aws-lambda-event-sources package, but just adding the topics property should allow customers to get started.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nija-atcommented, Sep 18, 2020

If I created the PR just adding the topics property, would that be rejected?

Definitely not. Feel free to post one.

0reactions
dscpinheirocommented, Sep 21, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::Lambda::EventSourceMapping - AWS CloudFormation
The AWS::Lambda::EventSourceMapping resource creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source ...
Read more >
AWS::Lambda::EventSourceMapping - Amazon CloudFormation
The AWS::Lambda::EventSourceMapping resource creates a mapping between an event source and an Amazon Lambda function. Lambda reads items from the event ...
Read more >
aws.lambda.EventSourceMapping - Pulumi
Provides a Lambda event source mapping. This allows Lambda functions to get events from Kinesis, DynamoDB, SQS, Amazon MQ and Managed Streaming for...
Read more >
AWS Lambda EventSourceMapping - CloudySave
AWS ::Lambda::EventSourceMapping resource: It helps you to create a mapping between an event source + a Lambda function. Lambda will start reading the...
Read more >
AWS Lambda Guide - Serverless.yml Reference
# List of existing Amazon SNS topics in the same region where notifications about stack events are sent. notificationArns: - 'arn:aws:sns: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found