I have 2 AWS lambda functions.
1 lambda:
const sendMessage = async (data) => {
const ebClient = new EventBridgeClient({});
const params = {
Entries: [
{
Detail: JSON.stringify(data),
DetailType: 'Message',
EventBusName: 'default',
Source: 'sendEvent',
Time: new Date()
}
]
}
const command = new PutEventsCommand(params);
await ebClient.send(command);
}
export const handler = async (event) => {
for await (const dta of event.params.data) {
sendMessage(dta);
}
}
and 2 lambda have only console.log now.
all works fine, but if i remove await from this line: await ebClient.send(command);, second lambda doesn’t call second time by eventbridge.
can someone help me?
New contributor
Ilya Shcherbakov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.