EventBridge Rule Testing doesn't work

0

Hello,

I'm trying to set up the eventbridge for custom events that my application will be raising. So I've been reading the documentation, got my eventbus created, added the API Destination and want to create a rule that should only forward events with a specific field to this destination. So according to the documentation, this is what an event would look like:

{
  "account": "123456789012",
  "detail-type": "Deployment History Notification",
  "source": "company.my-app",
  "detail": {
    "event": "deployment",
    "projectName": "app-that-got-deployed",
    "deploymentUrl": "https://myapp.com/api/deployments/:id.json",
    "version": "Tool 13.12.0"
  }
}

I've assumed this based on the documentation here: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html So now I want to match anything from my account, and that's a deployment, so I set up the following pattern in the rule:

{
  "account": ["123456789012"],
  "detail": {
    "event": ["deployment"]
  }
}

But the rules page keeps telling me that the example doesn't match the pattern. Why not? What did I miss? The documentation I am basing myself on is this one: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html

profile picture
Olivar
質問済み 2年前1765ビュー
1回答
2
承認された回答

The reason is that your sample event is not complete. You need to add to it the "id", "region" and "time" fields. It is annoying, but that is the way it works right now.

profile pictureAWS
エキスパート
Uri
回答済み 2年前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ