1
{
  "source": [
    "aws.mediaconvert"
  ],
  "detail-type": [
    "MediaConvert Job State Change"
  ],
  "detail": {
    "status": [
      "COMPLETE",
      "ERROR"
    ]
  }
}

My Follow:

  • Domain A: upload video to aws3 bukket A -> lambda create job mediaconvert -> cloudwatch Event rule (check complete) -> Call lambda call API of domain A
  • Domain B: upload video to aws3 bukket B -> lambda create job mediaconvert -> cloudwatch Event rule (check complete) -> Call lambda call API of domain B

At cloudwatch Event rule: How can i distinguish domain A and domain B ?

I tried to use "userMetadata" but incorrect

enter image description here

Tính Ngô Quang
  • 4,400
  • 1
  • 33
  • 33

1 Answers1

2

Event Patterns have a more strict format comparing to a simple JSON. It gets a key and verifies if the according event value is inside the list of values. So you can't set a value as a string inside a pattern. Use a list of values instead.

Example:

{
  "source": [
    "aws.mediaconvert"
  ],
  "detail-type": [
    "MediaConvert Job State Change"
  ],
  "detail": {
    "status": [
      "COMPLETE",
      "ERROR"
    ],
  "userMetadata": {
    "domain": [
        "A"
      ]
    }
  }
}

That is exactly the same what the error says. You can use only arrays as leaves of an event pattern.

Yann
  • 2,426
  • 1
  • 16
  • 33