I’m testing out the new Amazon EventBridge trigger on a few of my Lambdas and I’m getting errors when I try and add an EventBridge Event Bus source from a partner provider.
My current configuration is based on the Serverless example docs and I’m using Segment as the partner event source. Associations done manually through the AWS console work properly, but I get an error while deploying my changes when creating the
eventBridge trigger through Serverless.
Note: I am using Serverless v1.49.0 and deployments work as expected when no Event Bus is specified. This issue is only when associating with a partner event source
# ... functions: # ... create-request: handler: functions/handler.createRequest events: - eventBridge: eventBus: 'arn:aws:events:us-east-1:XXXXXXXXXXXX:event-bus/aws.partner/segment.com/XXXXXXXXXX' pattern: source: - 'aws.partner/segment.com/XXXXXXXXXX' detail: event: - 'My Event' type: - 'track' # ...
In AWS, the event bus is configured and I am able to manually create a lambda with a trigger from Segment events and log them to the console.
When a deploy is run with verbose logging, this is the first error message:
CloudFormation - CREATE_FAILED - Custom::EventBridge - CreateDashrequestCustomEventBridge1
Followed by a CloudFormation rollback and the following error output:
Serverless: Operation failed! Serverless: View the full error output: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3A[...] Unhandled rejection ServerlessError: An error occurred: CreateDashrequestCustomEventBridge1 - Failed to create resource. Event bus XXXXXXXXXX does not exist. See details in CloudWatch Log: 2019/08/06/[$LATEST][...].
(I was unable to find the CloudWatch log in the above output, and the CloudFormation page linked only shows the high level error output of
Both the Segment event bus and default bus show in the AWS EventBridge console but I can’t seem to get Serverless to reference the custom event bus properly.
Any assistance would be greatly appreciated.