amazon-web-servicesamazon-iamamazon-connect

Can Amazon Connect instance, without putEvent permissions, still publish Contact Events to default event bus?


Per docs here, I have set up an EventBridge rule to ingest Contact Events from an Amazon Connect Instance and then POST said events to an HTTP endpoint.

Problem: the HTTP endpoint handler has yet to receive a single Contact Event.

I looked at the permissions policies attached to the role created for this instance of Amazon Connect. The role permissions Amazon Connect for access to Kinesis Video Streams (for audio chunking), Kinesis Data Streams (for publishing Agent Events and/or Contract Trace Records), and Directory Service (which I don't grok).

QUESTION: shouldn't the Amazon Connect instance also be permissioned for publishing Contact Events to the default event bus? Eg, I would expect a policy like this:

{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Sid": "VisualEditor0",
        "Action": "events:PutEvents",
        "Effect": "Allow",
        "Resource": "arn:aws:events:us-west-2:1234567890:event-bus/default"
      }
    ]
}

However, if I create this policy and then attempt to attach it to the Amazon Connect instance role, I see this error:

enter image description here

How can I confirm Amazon Connect instance is publishing Contact Events to the default event bus?


Solution

  • The short answer is, "Yeah, it works."

    What I have confirmed is that for Contact Events from Amazon Connect instance, we do not actually require putEvent permissions (to EventBridge resource) in the Amazon Connect role. Instead, we can assume that said Contact Events are simply published to the "default event bus" (see docs), and that an EventBridge rule will pick up said events by screening for Contact Events from a specific instance of Amazon Connect.

    For example, the Pattern for the EventBridge rule might look like this:

    {
      "source": ["aws.connect"],
      "detail-type": ["Amazon Connect Contact Event"],
      "detail": {
        "instanceArn": ["arn:aws:connect:us-west-2:012345678901:instance/65fef175-25fc-4c38-881a-df4dbf150a3a"]
      }
    }