
I Tried Out EventBridge's Newly Supported Webhook Events
This page has been translated by machine translation. View original
Introduction
On November 20, 2026, Amazon EventBridge's enhanced Custom event bus added support for Webhook Events.
When you create a webhook event source on a Custom event bus (hereafter, bus), EventBridge issues an HTTPS URL. EventBridge authenticates requests that arrive at this URL, and the ones it accepts can be handled as events on the bus.
In this article, I created an event source and tried receiving a signed request sent with curl through a Subscriber that targets SQS.
Test environment
- Region: Tokyo (ap-northeast-1)
- aws-cli: 2.42.1
- Sending requests: curl
- Computing signatures:
openssl dgst - Extracting values: jq
I omitted --region from the commands and ran them with the Tokyo region as the default.
Preparation
First I created the bus, SQS queues, and IAM roles that the event source and Subscriber refer to.
Bus and queues
I created two queues: an all queue (ebwh-verify-all-q) that receives every event, and a filter queue (ebwh-verify-filter-q) that receives narrowed-down events.
aws eventsv2 create-event-bus --name ebwh-verify-bus --description "webhook events verification"
aws sqs create-queue --queue-name ebwh-verify-all-q
aws sqs create-queue --queue-name ebwh-verify-filter-q
I checked the bus status with list-event-buses.
aws eventsv2 list-event-buses
When I ran it about 12 seconds after creation, State was ACTIVE.
IAM roles
I created a role for the event source.
In the trust policy, I allowed events.amazonaws.com to assume this role.
trust-policy.json
{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" }, "Action": "sts:AssumeRole" }
]
}
In the permissions policy, I allowed publishing to the bus and reading the secret used to verify signatures. EventBridge creates secrets with names starting with events-webhook!, so I set the Resource of ReadWebhookSecret to a wildcard on this prefix.
webhook-role-policy.json
{
"Version": "2012-10-17",
"Statement": [
{ "Sid": "PublishWebhookEvents", "Effect": "Allow", "Action": "events:PutWebhookEvents", "Resource": "arn:aws:events:ap-northeast-1:123456789012:event-busv2/ebwh-verify-bus/<生成ID>" },
{ "Sid": "ReadWebhookSecret", "Effect": "Allow", "Action": "secretsmanager:GetSecretValue", "Resource": "arn:aws:secretsmanager:ap-northeast-1:123456789012:secret:events-webhook!*" }
]
}
For the bus ARN in Resource, I entered the EventBusArn value from the create-event-bus response.
aws iam create-role \
--role-name ebwh-verify-webhook-role \
--assume-role-policy-document file://trust-policy.json
aws iam put-role-policy \
--role-name ebwh-verify-webhook-role \
--policy-name webhook-publish-and-read-secret \
--policy-document file://webhook-role-policy.json
I also created a role for the Subscriber to deliver to SQS.
Role for Subscriber delivery
delivery-role-policy.json
{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Action": "sqs:SendMessage", "Resource": [
"arn:aws:sqs:ap-northeast-1:123456789012:ebwh-verify-all-q",
"arn:aws:sqs:ap-northeast-1:123456789012:ebwh-verify-filter-q" ] }
]
}
I reused trust-policy.json for the trust policy.
aws iam create-role \
--role-name ebwh-verify-delivery-role \
--assume-role-policy-document file://trust-policy.json
aws iam put-role-policy \
--role-name ebwh-verify-delivery-role \
--policy-name send-to-queues \
--policy-document file://delivery-role-policy.json
Setting variables
I put the values used in the following commands into variables. The queue URLs are the QueueUrl values from the create-queue responses.
export BUS_ARN=arn:aws:events:ap-northeast-1:123456789012:event-busv2/ebwh-verify-bus/<生成ID>
export QUEUE_FILTER_ARN=arn:aws:sqs:ap-northeast-1:123456789012:ebwh-verify-filter-q
export DELIVERY_ROLE_ARN=arn:aws:iam::123456789012:role/ebwh-verify-delivery-role
export QUEUE_ALL_URL=https://sqs.ap-northeast-1.amazonaws.com/123456789012/ebwh-verify-all-q
export QUEUE_FILTER_URL=https://sqs.ap-northeast-1.amazonaws.com/123456789012/ebwh-verify-filter-q
Webhook event source
I created the event source after waiting several tens of seconds from the creation of the IAM roles.
Creation
I created an event source that authenticates with HMAC signatures.
source-hmac.json
{
"WebhookEventsConfiguration": {
"AuthConfiguration": {
"HmacAuthConfiguration": {
"Algorithm": "SHA256",
"Encoding": "HEX",
"SignatureHttpHeader": "X-Signature",
"SignedMessageComposition": "BODY"
}
},
"RoleArn": "arn:aws:iam::123456789012:role/ebwh-verify-webhook-role"
}
}
aws eventsv2 create-event-source \
--name ebwh-hmac \
--event-bus-arn "$BUS_ARN" \
--configuration file://source-hmac.json | tee src-hmac.json
I saved the response to src-hmac.json with tee. What I use from here on are the WebhookUrl and SecretArn in the response.
{
"State": "ACTIVE",
"EventSourceDetails": {
"WebhookDetails": {
"WebhookUrl": "<masked>",
"SecretArn": "arn:aws:secretsmanager:ap-northeast-1:123456789012:secret:events-webhook!EXAMPLE-a1b2c3"
}
}
}
Secret
I obtained the key used to compute signatures from the Secrets Manager secret that SecretArn points to. For HMAC, SecretString was not JSON but the key string itself. I put the URL and the secret into environment variables for sending.
SECRET_ARN=$(jq -r .EventSourceDetails.WebhookDetails.SecretArn src-hmac.json)
export WEBHOOK_URL=$(jq -r .EventSourceDetails.WebhookDetails.WebhookUrl src-hmac.json)
export SECRET=$(aws secretsmanager get-secret-value --secret-id "$SECRET_ARN" --query SecretString --output text)
Subscriber
I created two Subscribers targeting SQS. One is configured to receive every event, and the other uses a DATA-scope filter to receive only events whose status is delivered. Both receive with WITH_METADATA, so Metadata and SystemMetadata were also delivered.
I created the Subscriber with the filter using the following command.
aws eventsv2 create-subscriber \
--name ebwh-sub-filter \
--event-bus-arn "$BUS_ARN" \
--type UNORDERED \
--transformer '{"Type":"WITH_METADATA"}' \
--filter-configuration '{"Filters":[{"Scope":"DATA","Pattern":"{\"status\":[\"delivered\"]}"}]}' \
--invoke-configuration "{\"TargetArn\":\"$QUEUE_FILTER_ARN\",\"RoleArn\":\"$DELIVERY_ROLE_ARN\"}"
For ebwh-sub-all, which receives every event, I created it in the same form without --filter-configuration and with the all queue as the destination.
Sending and receiving requests
Signed request
I put signature computation and sending together in the following script. If you pass a value as the second argument, it is sent as the signature; if you pass none, the request is sent without the signature header.
send-hmac.sh
#!/usr/bin/env bash
# Send a signed POST to an HMAC (SHA256, HEX, BODY) webhook.
# Required environment variables: WEBHOOK_URL (WebhookUrl from the creation response), SECRET (secret value from Secrets Manager)
# Usage: send-hmac.sh '<body>' [signature override value|none]
set -euo pipefail
BODY="$1"
if [ "${2:-}" = "none" ]; then
curl -sS -i -X POST "$WEBHOOK_URL" -H 'Content-Type: application/json' --data-binary "$BODY"
else
SIG="${2:-$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $NF}')}"
curl -sS -i -X POST "$WEBHOOK_URL" -H 'Content-Type: application/json' -H "X-Signature: $SIG" --data-binary "$BODY"
fi
bash send-hmac.sh '{"orderId":"ORD-1001","status":"delivered","carrier":"example-logistics"}'
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 2
OK
I also sent ORD-1002, with status set to in_transit, in the same way, and 200 was returned for both. I checked the messages that arrived in the queues with the following command.
aws sqs receive-message \
--queue-url "$QUEUE_ALL_URL" \
--max-number-of-messages 10 \
--wait-time-seconds 10 \
--query 'Messages[].Body'
I received from the filter queue in the same way, changing it to --queue-url "$QUEUE_FILTER_URL". ORD-1001 arrived in both all and filter, and ORD-1002 arrived only in all.
In the all queue, the first receive-message returned only ORD-1002, and the second returned ORD-1001. If a single receive does not return all messages, receive again in succession.
Received event
This is the body of ORD-1001 received from the filter queue.
{
"Data": {
"orderId": "ORD-1001",
"status": "delivered",
"carrier": "example-logistics"
},
"Metadata": {},
"SystemMetadata": {
"EventGroupId": "<UUID>",
"DeduplicationId": "<UUID>",
"ContentType": "application/json",
"aws:IngestionTime": "2026-11-21T15:40:57.790Z",
"aws:EventId": "<UUID>",
"aws:SequenceNumber": "10000000000000003000",
"aws:DeliveryType": "LIVE"
}
}
The JSON I sent went into Data as is, including the key order. On the receiving side, read the sender's payload from Data.
Request with a mismatched signature
I sent a POST with a signature consisting of 64 0 digits, and a POST without the signature header.
bash send-hmac.sh '{"orderId":"ORD-9001","status":"delivered","carrier":"example-logistics"}' 0000000000000000000000000000000000000000000000000000000000000000
bash send-hmac.sh '{"orderId":"ORD-9002","status":"delivered","carrier":"example-logistics"}' none
The POST with the wrong signature returned the following response.
HTTP/1.1 403 Forbidden
Content-Type: text/plain
Content-Length: 9
Forbidden
The POST without the signature header also returned 403. Neither request arrived in either the all queue or the filter queue.
Static token and Basic authentication
The authentication method cannot be changed after the event source is created, so besides HMAC, I created event sources for a static token and for Basic authentication.
source-token.json
{
"WebhookEventsConfiguration": {
"AuthConfiguration": {
"StaticTokenAuthConfiguration": { "TokenHttpHeader": "X-Webhook-Token" }
},
"RoleArn": "arn:aws:iam::123456789012:role/ebwh-verify-webhook-role"
}
}
source-basic.json
{
"WebhookEventsConfiguration": {
"AuthConfiguration": {
"BasicHttpAuthConfiguration": {}
},
"RoleArn": "arn:aws:iam::123456789012:role/ebwh-verify-webhook-role"
}
}
For both the static token and the Basic authentication username and password, I did not specify them in the configuration files and used the values generated by EventBridge.
aws eventsv2 create-event-source \
--name ebwh-token \
--event-bus-arn "$BUS_ARN" \
--configuration file://source-token.json | tee src-token.json
aws eventsv2 create-event-source \
--name ebwh-basic \
--event-bus-arn "$BUS_ARN" \
--configuration file://source-basic.json | tee src-basic.json
For the static token event source, SecretString was the token value itself. I retrieved it with the same procedure as for HMAC and sent it in the X-Webhook-Token header.
send-token.sh
#!/usr/bin/env bash
# POST to a static token webhook. Required: WEBHOOK_URL, SECRET (token value)
set -euo pipefail
curl -sS -i -X POST "$WEBHOOK_URL" -H 'Content-Type: application/json' -H "X-Webhook-Token: $SECRET" --data-binary "$1"
SECRET_ARN=$(jq -r .EventSourceDetails.WebhookDetails.SecretArn src-token.json)
export WEBHOOK_URL=$(jq -r .EventSourceDetails.WebhookDetails.WebhookUrl src-token.json)
export SECRET=$(aws secretsmanager get-secret-value --secret-id "$SECRET_ARN" --query SecretString --output text)
bash send-token.sh '{"orderId":"ORD-2001","status":"delivered"}'
For the Basic authentication event source, the secret was JSON containing username and password. I extracted each and sent them with curl's -u.
send-basic.sh
#!/usr/bin/env bash
# POST to a Basic authentication webhook. Required: WEBHOOK_URL, BASIC_USER, BASIC_PASS
set -euo pipefail
curl -sS -i -X POST "$WEBHOOK_URL" -u "$BASIC_USER:$BASIC_PASS" -H 'Content-Type: application/json' --data-binary "$1"
SECRET_ARN=$(jq -r .EventSourceDetails.WebhookDetails.SecretArn src-basic.json)
export WEBHOOK_URL=$(jq -r .EventSourceDetails.WebhookDetails.WebhookUrl src-basic.json)
BASIC_SECRET=$(aws secretsmanager get-secret-value --secret-id "$SECRET_ARN" --query SecretString --output text)
export BASIC_USER=$(echo "$BASIC_SECRET" | jq -r .username)
export BASIC_PASS=$(echo "$BASIC_SECRET" | jq -r .password)
bash send-basic.sh '{"orderId":"ORD-3001","status":"delivered"}'
With both methods, when I sent one request each with the correct credentials, HTTP 200 was returned. ORD-2001 (static token) and ORD-3001 (Basic authentication) arrived in the filter queue because their status is delivered.
Summary
I confirmed that with Amazon EventBridge Webhook Events, requests sent from curl can be received and processed as events.
The sender does not need to use IAM authentication and can send using any of HMAC signatures, a static token, or Basic authentication, so I think it is also easy to use for integrations from outside AWS.
If you have previously set up a similar mechanism with API Gateway and Lambda, for example, please try this update.
