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.

bucket event notifications creates placeholder lambda function

See original GitHub issue

Describe the bug When you use function.addEventSource(new S3EventSource(...)) or bucket.addObjectCreatedNotification(...) it creates a BucketNotificationsHandler lambda function with some placeholder code.

To Reproduce

    const bucket = new Bucket(this, 'TestBucket');
    const lambda = new Function(this, 'TestFunction', {
      code: Code.asset('./test-src'),
      runtime: Runtime.NodeJS10x,
      handler: 'index.handler',
      description: 'Example function',
    });
    lambda.addEventSource(new S3EventSource(bucket, {
      events: [EventType.ObjectCreated],
    }));

Expected behavior Should only connect the TestFunction to the lambda function not create a new placeholder function.

Version:

  • macOS 10.14.5
  • Typescript
  • 0.33

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
jthornbruecommented, Aug 1, 2019

My stack contains an object created notification that triggers an SNS topic. See below (using the Python API):

my_bucket.add_event_notification(
        aws_s3.EventType.OBJECT_CREATED,
        aws_s3_notifications.SnsDestination(my_topic),
        aws_s3.NotificationKeyFilter(
            prefix=OUTPUT_PREFIX,
            suffix='.csv'
        )
    )

This creates a dummy lambda function in the stack–even though there is not and never will be a lambda target. This is annoying. Any progress on this bug?

6reactions
LechuckThePiratecommented, Sep 26, 2019

This should be solved. I don’t understand how this went out of beta with this problem. If you run into this, it’s not just that you have a lambda function there that shouldn’t be there… the thing is you are actually PAYING for every S3 bucket event…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Amazon S3 Event Notifications using a Lambda ...
The Lambda function manages S3 Event Notifications and is required to create, update, and delete notifications from events that take place ...
Read more >
S3 to SQS to Lambda - Serverless Land
Create a Lambda function that resizes images uploaded to S3 via SQS. The SAM template deploys a Lambda function, an SQS queue, 2...
Read more >
Triggering Lambda function on S3 file upload - 5K Team
First, you need to create the handler lambda import { S3CreateEvent } from 'aws-lambda'; export async function handler(event: ...
Read more >
Create S3 Event Notification using AWS Lambda Function
Using Amazon S3 Event Notifications, you can be notified when certain events occur in your S3 bucket. Configure Amazon S3 to publish events...
Read more >
Build a Realtime Notification Feed for AWS S3 - GetStream.io
Your AWS Lambda function will now be triggered whenever a user downloads, views, or uploads an object in the buckets you specified! Monitor...
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