Eventbridge Scheduler


Hi, I'm trying to create a new eventbridge scheduler with universal target arn:aws:scheduler:::aws-sdk:eventbridge:PutEvents but I get the following error on deployment: Invalid request provided: Invalid RequestJson provided. Reason The api PutEvents is not valid for the service aws-sdk:eventbridge.

My input is: '{"EndpointId":"string","Entries":[{"Detail":"string","DetailType":"string","EventBusName":"string","Resources":["string"],"Source":"string","Time": 0,"TraceHeader":"string"}]}'

Does anyone know what I am doing wrong ?

Many Thanks in advance

2 Answers

Hi I might be misreading your question, but it sounds like you're literally passing {"EndpointId":"string","Entries":[{"Detail":"string","DetailType":"string","EventBusName":"string","Resources":["string"],"Source":"string","Time": 0,"TraceHeader":"string"}]}, which is the template format defined at https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html.

You need to pass real values as defined in the above page.

If you are already actually passing real values, what are they?

answered a year ago

I've not got the full idea what you are actually trying. But if you are trying to put events on the desired EventBusName using PutEvents [1] api call for the EventBridge service. Then you can follow the below steps:

  1. Create a rule in eventbridge. You can use a sample event 'AWS events -> Scheduled Events' or you can provide your own sample message like below [1] (mentioned keys in the below json are the min required fields):
  "version": "0",
  "id": "89d1a02d-5ec7-412e-82f5-13505f849b41",
  "detail-type": "Scheduled Event",
  "source": "com.mycompany.myapp",
  "account": "123456789012",
  "time": "2023-04-28T00:39:04Z",
  "region": "us-east-1"
  1. Then in the event patter you can mention the desired pattern, the bare minimum could be like below:
  "source": ["com.mycompany.myapp"]

I've tested the above and it's working fine on the sandbox also when I put the event using the aws cli. Let me know if you still have any questions.

[1] https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html#eventbridge-PutEvents-request-Entries

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions