
Invoke an Amazon Bedrock AgentCore Runtime agent directly from Amazon EventBridge without AWS Lambda glue code, using an API Destination with Amazon Cognito M2M OAuth.
cdk deploy gives you a working pattern.client_credentials grant and sends it as a Bearer token. The AgentCore Runtime validates the JWT with a customJwtAuthorizer wired to the same Cognito user pool, so there's no manual step after deploy.@app.async_task decorator, which keeps the session alive. Deliveries that still fail after three retries go to an Amazon SQS dead-letter queue. Failures in the background work are logged to Amazon CloudWatch Logs.git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-apidestination-agentcore/typescript/cdkcd cdknpm installcdk deployaws events put-events --entries '[{"EventBusName":"agentcore-events","Source":"demo.orders","DetailType":"OrderCreated","Detail":"{\"orderId\":\"12345\",\"prompt\":\"Summarize this order and flag any anomalies.\"}"}]'/aws/bedrock-agentcore/runtimes/<AgentRuntimeId>-DEFAULT) to see the event arrive and the background processing run.aws events describe-connection --name agentcore-cognito-oauth should show AUTHORIZED.aws sqs receive-message --queue-url <DeadLetterQueueUrl output>.cdk folder: cdk destroy