AWS EventBridge - Custom Resource

Hi there,

I’ve recently started used Serverless and am in the process of creating a simple application using EventBridge.

I’m developing Lambda using Python and have a few functions running. I notice though that when I use a custom EventBridge (referenced via an ARN) in my Serverless definition I end up with a node Lambda function as well.

I’ve been digging through the documentation and don’t see any reference to this and was wondering if I maybe have just mucked something up in my configuration.

Here’s a snippet of my Serverless configuration with the reference to the custom EventBridge bus.

eventLogger:
  description: Log Insight events to DynamoDB table
  environment:
    EVENT_TABLE: 'XXX'
  handler: src/event_logger.lambda_handler
  events:
    - eventBridge:
        eventBus: arn:aws:events:us-east-1:123456789012:event-bus/insights-development
        pattern:
          source:
            - co.insights

Here’s a snippet of what I see in the CloudFormation console for this Lambda function:

Can anyone help shed some light on this for me?

Thanks,

2 Likes

I found this post while investigating the same thing. It seems to be named “<stack name>-custom-resource-event-bridge”.

Cloudwatch says this lambda is being invoked, but I’m not sure from where, or why.

I noticed the same Lambda in my account when using EventBridge as event source. My understanding is that is used only to create the event rules. It has been invoked only at the beginning a couple of times.

I am experimenting the same thing with serverless 3.0, when deploying a lambda using:

events:
      - eventBridge:
          eventBus: arn:aws:events:eu-west-1:*********:event-bus/default
          schedule: cron(0 * * * ? *)

Serverless create a role and a node Lambda in charge of creating the rule and granting some permissions.

This a very strange behavior we totally cannot adopt.

Does anyone know why such a design? And is it possible to bypass this?

Did anyone manage to get to the root of the issue? Even I have this issue and I want to update the node run time (not manually from console) of this automatically created lambda at least.