Hi all,
Problem
wem are trying to automate our EventBridge Topic Subscriptions using the Python SDK because manual UI clicks don’t scale for our hybrid setup.
wem have a script that constructs the Subscription Payload with the Topic ARN Reference and Filter Policy Matrix, but the Atomic POST operation keeps bombing out.
wem need the Automatic Confirmation Subscription Trigger to fire reliably so wem don’t get stuck in a pending state, but the Event Gateway Constraints seem to be rejecting the Endpoint Destination Directives.
Code
import requests
# Constructing subscription payload
subscription_payload = {
"TopicArn": "arn:aws:events:us-west-2:123456789:topic/genesys-cloud-routing-events",
"Protocol": "lambda",
"Endpoint": "arn:aws:lambda:us-west-2:123456789:function:EventProcessor",
"FilterPolicy": {
"EventType": ["routing.call.queued", "routing.call.answered"],
"Region": ["us-west-2"]
}
}
# Atomic POST operation
response = session.post(
f"{BASE_URL}/api/v2/notifications/channels/{channelId}/subscriptions",
headers=auth_headers,
json=subscription_payload
)
Error
The response comes back with a 400 Bad Request.
The validation logic using IAM Permission Checking and Endpoint Reachability Verification Pipelines should have passed locally, but the server is throwing this JSON:
{
"message": "Subscription schema validation failed. Maximum Subscriber Count Limits exceeded or invalid Endpoint Destination Directives format.",
"code": "bad_request",
"status": 400,
"details": [
"FilterPolicy matrix does not align with Event Gateway Constraints for this Topic ARN Reference."
]
}
Question
Has anyone managed to get the Subscription Validation Logic working with the Python SDK?
The local checks pass for the IAM Permission Checking and Endpoint Reachability Verification Pipelines.
wem are also trying to track Subscription Latency and Message Delivery Rates for Topic Efficiency, but the Subscription Audit Logs for Event Governance aren’t generating if the POST fails.
Just need to expose a Topic Subscriber for Automated Event Management without hitting these Dead Letter Queue Overflow risks during Event Scaling.