AWS SNS Subscription Nested Filter

27 Views Asked by At

I am currently trying to set up a pipeline where certain users get notified of Datasync task completion based on the taskID. I have the event triggering, SQS queue set up, and SNS is receiving messages.

The message itself looks like this:

{
      "version":"0",
      "id":"506a552c-ab57-2f34-81fc-7dd9e41b3ed1",
      "detail-type":"DataSync Task Execution State Change",
      "source":"aws.datasync",
      "account":"999999999999",
      "time":"2024-01-03T05:02:41Z",
      "region":"ca-central-1",
      "resources":["arn:aws:datasync:ca-central-1:999999999999:task/task-09b5938df707a55ef/execution/exec-0c97c2fdbc1db8e2f"],
      "detail":{"State":"SUCCESS"}
}

What I'm not sure on is the filter policy itself, I want to be able to filter on the resource key using a prefix that inclucdes the taskID, but I think it's failing because it's an array. Here's my filter:

{
      “resources” : [{“prefix”: “arn:aws:datasync:ca-central-1:999999999999:task/task-09b5938df707a55ef”}]
}

Any insight would be greatly appreciated!

0

There are 0 best solutions below