Is it possible to configure tag-based policies for the EventBridge PutEvents action?
My hope was that, based on tags in an IAM role, I could control which roles have access to PutEvents on specific event buses. I have attempted to do this with the following resource policy:
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "allow_tags_to_put_events",
"Effect": "Allow",
"Principal": "*",
"Action": "events:PutEvents",
"Resource": "<event-bus-arn>",
"Condition": {
"StringEquals": {
"aws:RequestTag/stage": "test"
}
}
}]
}
This would allow any IAM role tagged with stage=test
to be able to PutEvents. But this doesn't appear to be working. Reading this https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoneventbridge.html suggests that maybe PutEvents
doesn't support the aws:RequestTag
condition, but SOME of the actions do, which seems extremely odd to me.