According AWS it should be possible to send events directly to AWS EventBridge via API Gateway: https://aws.amazon.com/blogs/compute/capturing-client-events-using-amazon-api-gateway-and-amazon-eventbridge/
The preceding API Gateway AWS integration enables API Gateway to send the events to EventBridge without using compute services, such as Lambda or Amazon EC2. The integration and IAM execution role enable API Gateway to call the EventBridge PutEvents API to do this.
I tried to implement this with REST API Gateway:
But when calling the endpoint, I am receiving:
{ "__type": "UnknownOperationException" }
I read from other posts that you need to have correct request headers included (Cloudwatch Logs PutLogEvents action fails with com.amazon.coral.service#UnknownOperationException when called from API Gateway and com.amazon.coral.service#UnknownOperationException when triggering CodeBuild from API Gateway). I have tried this with:
'Content-Type: application/x-amz-json-1.1'
'X-Amz-Target: AWSEvents.PutEvents'
Payload for the API is:
{
"Entries":[
{
"Source":"maksim.test",
"Detail":"{ 'name': 'Maksim', 'action': 'testing'}",
"Resources":[
"resource1",
"resource2"
],
"DetailType":["Custom Maksim test event"]
}
]
}
But still same error. Any ideas what I am doing wrong?