Can't create two lambdas using the same eventBus
See original GitHub issueBug Report
Description
Create two lambda functions using the same eventBus on EventBridge service gives an error that eventBus cannot be created.
-
What did you do? Try to create two lambda functions using the same event bus
-
What happened? Gives an error failed to create resource already exists
-
What should’ve happened? Create the two lambdas using the same eventBus
-
What’s the content of your
serverless.yml
file?
service: my-service
provider:
name: aws
stage: ${opt:stage}
runtime: go1.x
region: us-east-1
package:
exclude:
stage: ${opt:stage}
- ./**
include:
- ./bin/**
functions:
plans-create:
handler: bin/eventbridge/plans/create
events:
- eventBridge:
eventBus: mybus-${opt:stage}
pattern:
source:
- prod.admin.plans
detail-type:
- plan-created
plans-update:
handler: bin/eventbridge/plans/update
events:
- eventBridge:
eventBus: mybus-${opt:stage}
pattern:
source:
- prod.admin.plans
detail-type:
- plan-updated
Failed to create resource. Event bus mybus-dev already exists.
Similar or dependent issues:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:19 (3 by maintainers)
Top Results From Across the Web
Is it possible to set multiple eventbridge rules on a lambda?
Yes, It is possible with a little workaround. Create rules as resources. Add your lambda as target to the created rules. Note: Make...
Read more >Is it possible to set multiple eventbridge rules on a lambda?
Yes, It is possible with a little workaround. Create rules as resources. Add your lambda as ...
Read more >Tutorial: Schedule AWS Lambda functions using EventBridge
Enter a name and description for the rule. A rule can't have the same name as another rule in the same Region and...
Read more >Receiving events using Amazon Lambda function URLs
You can also create an event bus by selecting New event bus. Under Step 2: Set up using CloudFormation, choose New GitHub webhook....
Read more >How To Put Event Data On AWS Event Bus Using Lambda?
Both EventBridge and SQS provide messaging patterns for your serverless setup whether it is simple messaging or pub/sub. What Is AWS EventBridge? AWS ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok find a way to workaround this, like the following example, but it needs at least the
arn:aws
to work@TreeMan360 Got the same
EventBus.startsWith is not a function
error with:The event bus is being created fine when using resources, but I can’t reference with
GetAtt
.So far I’m having 2 issues:
!GetAtt
norFn::GetAtt
.I can work this around with the custom attribute hardcoding the ARN as Eduardo did in this thread, but would be good to do it in more declarative way rather than hardcoding ARN’s.