
I Tried Out Delivery to a New Custom Event Bus and AWS SDK Integration with EventBridge Scheduler
This page has been translated by machine translation. View original
Introduction
On November 20, 2026, AWS announced expanded AWS SDK integrations for Amazon EventBridge Scheduler and templated targets for the new custom event bus.
Without going through a Lambda function, Scheduler can deliver events to the new custom event bus and call AWS APIs with universal targets that use AWS SDK integrations.
This article shows the results of creating Schedules with the AWS CLI and trying delivery to the bus, as well as EC2 and Lambda API calls through universal targets.
Test Environment
- Region: Tokyo (ap-northeast-1)
- aws-cli: 2.42.1
Preparation for the Test
Bus and Subscriber
You operate the new custom event bus with the eventsv2 command.
aws eventsv2 create-event-bus --name sch-v2-bus --description "scheduler verification bus"
The EventBusArn in the response is used to create the Subscriber and as the Resource in the execution role's policy.
First, create the SQS queue that is the Subscriber's delivery destination and the role used for delivery.
Creating the queue and delivery role
aws sqs create-queue --queue-name sch-v2-q
aws iam create-role \
--role-name sch-v2-delivery-role \
--assume-role-policy-document file://trust-events.json \
--query Role.RoleName --output text
aws iam put-role-policy \
--role-name sch-v2-delivery-role \
--policy-name send-to-queue \
--policy-document file://policy-delivery.json
trust-events.json
{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" }, "Action": "sts:AssumeRole" }
]
}
policy-delivery.json
{ "Version": "2012-10-17",
"Statement": [ { "Effect": "Allow", "Action": "sqs:SendMessage", "Resource": "arn:aws:sqs:ap-northeast-1:123456789012:sch-v2-q" } ] }
Create the Subscriber before the Schedule. Do not specify StartingPosition or Transformer, and deliver events to the SQS queue. To keep the event body in the logs, set IncludePayload to FULL.
aws eventsv2 create-subscriber \
--name sch-v2-sub \
--event-bus-arn <バスのARN> \
--type UNORDERED \
--invoke-configuration '{"TargetArn":"<キューのARN>","RoleArn":"<配信ロールのARN>"}' \
--log-configuration '{"Level":"INFO","IncludePayload":"FULL"}'
Scheduler Execution Role
Create a role that Scheduler assumes, and attach PutEvents and PutRawEvents permissions with the bus ARN as the Resource. The CLI command name is eventsv2, but the IAM action prefix and the service name in the ARN are events.
Creating the role and trust policy
aws iam create-role \
--role-name sch-v2-scheduler-role \
--assume-role-policy-document file://trust-scheduler.json \
--query Role.RoleName --output text
trust-scheduler.json
{
"Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Principal": { "Service": "scheduler.amazonaws.com" }, "Action": "sts:AssumeRole" }
]
}
policy-scheduler.json
{ "Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Action": ["events:PutEvents", "events:PutRawEvents"], "Resource": "arn:aws:events:ap-northeast-1:123456789012:event-busv2/sch-v2-bus/EXAMPLE1234567890abcdef" }
] }
aws iam put-role-policy \
--role-name sch-v2-scheduler-role \
--policy-name scheduler-targets \
--policy-document file://policy-scheduler.json
Log Delivery
Send the Subscriber's delivery records to CloudWatch Logs.
Log delivery commands
aws logs create-log-group --log-group-name /aws/vendedlogs/sch-v2-sub
aws logs put-delivery-source \
--name sch-v2-source \
--resource-arn <SubscriberのARN> \
--log-type INFO_LOGS
aws logs put-delivery-destination \
--name sch-v2-destination \
--delivery-destination-configuration destinationResourceArn=<ロググループのARN>
aws logs create-delivery \
--delivery-source-name sch-v2-source \
--delivery-destination-arn <delivery-destinationのARN>
Scheduled Delivery to the New Custom Event Bus
The items you can specify in a templated target are summarized in the following documentation.
PutEvents
Specify the bus ARN in the Target's Arn, and write Source and DetailType in EventBridgePutEventsV2Parameters.
target-puteventsv2.json
{
"RoleArn": "arn:aws:iam::123456789012:role/sch-v2-scheduler-role",
"Arn": "arn:aws:events:ap-northeast-1:123456789012:event-busv2/sch-v2-bus/EXAMPLE1234567890abcdef",
"Input": "{\"orderId\":\"1001\",\"total\":42.5}",
"EventBridgePutEventsV2Parameters": { "Source": "com.example.scheduler", "DetailType": "NightlyReconciliation" }
}
For at() in schedule-expression, I specified a time later than the moment of creation.
aws scheduler create-schedule \
--name sch-v2-putevents \
--schedule-expression "at(2026-11-23T12:39:00)" \
--schedule-expression-timezone Asia/Tokyo \
--flexible-time-window Mode=OFF \
--target file://target-puteventsv2.json
I examined the received event with Logs Insights. For start-time and end-time, specify a range that brackets the Schedule's execution time, in epoch seconds.
aws logs start-query \
--log-group-name /aws/vendedlogs/sch-v2-sub \
--start-time <開始のエポック秒> \
--end-time <終了のエポック秒> \
--query-string 'fields @timestamp, event_id, details.outcome, details.terminal_kind, details.target_input, details.event_system_metadata.ContentType | filter message_type = "EVENT_DELIVERY_ATTEMPT" | sort @timestamp asc'
aws logs get-query-results --query-id <queryId>
The PutEvents result was as follows.
[
{ "field": "@timestamp", "value": "2026-11-23 03:39:16.573" },
{ "field": "event_id", "value": "ae07a743-865e-4e02-a700-e8eae7ef5af7" },
{ "field": "details.outcome", "value": "SUCCESS" },
{ "field": "details.terminal_kind", "value": "EVENTS_DELIVERED" },
{ "field": "details.target_input", "value": "{\"version\":\"0\",\"id\":\"05cac061-3eb7-46c2-a488-931b7a2c17d5\",\"detail-type\":\"NightlyReconciliation\",\"source\":\"com.example.scheduler\",\"account\":\"123456789012\",\"time\":\"2026-11-23T03:39:16Z\",\"region\":\"ap-northeast-1\",\"resources\":[],\"detail\":{\"orderId\":\"1001\",\"total\":42.5}}" },
{ "field": "details.event_system_metadata.ContentType", "value": "application/eventbridge+json" }
]
The event arrives in the same envelope as the conventional custom event bus (Classic), and Input is placed under detail.
The body received in the SQS queue, the delivery destination of the Subscriber with no Transformer specified, was identical to target_input in the log.
PutRawEvents and Metadata
With PutRawEvents, you specify the metadata to attach to the event in Metadata of EventBridgePutRawEventsParameters.
target-putrawevents.json
{
"RoleArn": "arn:aws:iam::123456789012:role/sch-v2-scheduler-role",
"Arn": "arn:aws:events:ap-northeast-1:123456789012:event-busv2/sch-v2-bus/EXAMPLE1234567890abcdef",
"Input": "{\"orderId\":\"1002\",\"total\":42.5}",
"EventBridgePutRawEventsParameters": { "Metadata": { "tenant": "acme", "job": "nightly-reconciliation" } }
}
aws scheduler create-schedule \
--name sch-v2-putrawevents \
--schedule-expression "at(2026-11-23T12:39:30)" \
--schedule-expression-timezone Asia/Tokyo \
--flexible-time-window Mode=OFF \
--target file://target-putrawevents.json
After the Schedule ran, I executed the same query as for PutEvents again, and the PutRawEvents event appeared as the second result.
[
{ "field": "@timestamp", "value": "2026-11-23 03:40:10.179" },
{ "field": "event_id", "value": "be444868-0441-44dd-9877-574ecba2c77b" },
{ "field": "details.outcome", "value": "SUCCESS" },
{ "field": "details.terminal_kind", "value": "EVENTS_DELIVERED" },
{ "field": "details.target_input", "value": "{\"orderId\":\"1002\",\"total\":42.5}" },
{ "field": "details.event_system_metadata.ContentType", "value": "application/json" }
]
Input arrived as is. I did not specify ContentType in the Target, but application/json was attached.
Metadata goes into details.event_metadata.<キー> in the Subscriber's log. You can retrieve it by specifying the key name in the query.
aws logs start-query \
--log-group-name /aws/vendedlogs/sch-v2-sub \
--start-time <開始のエポック秒> \
--end-time <終了のエポック秒> \
--query-string 'fields @timestamp, event_id, details.event_metadata.tenant, details.event_metadata.job | filter message_type = "EVENT_DELIVERY_ATTEMPT" | sort @timestamp asc'
The result for the event sent with PutRawEvents was as follows.
[
{ "field": "@timestamp", "value": "2026-11-23 03:40:10.179" },
{ "field": "event_id", "value": "be444868-0441-44dd-9877-574ecba2c77b" },
{ "field": "details.event_metadata.tenant", "value": "acme" },
{ "field": "details.event_metadata.job", "value": "nightly-reconciliation" }
]
The body that arrived in the SQS queue from the Subscriber with no Transformer specified was only {"orderId":"1002","total":42.5}, and it did not include the Metadata.
Calling APIs with Universal Targets
For a universal target, specify arn:aws:scheduler:::aws-sdk:<サービス>:<アクション> in Arn. For Input, pass the request parameters of the target API as a JSON string.
Here are the results of calling EC2 and Lambda APIs.
Stopping an EC2 Instance
Prepare a running EC2 instance. Running put-role-policy with the same policy name overwrites the execution role's policy. Therefore, add the ec2:StopInstances Statement while keeping the events Statement.
policy-scheduler.json
{ "Version": "2012-10-17",
"Statement": [
{ "Effect": "Allow", "Action": ["events:PutEvents", "events:PutRawEvents"], "Resource": "arn:aws:events:ap-northeast-1:123456789012:event-busv2/sch-v2-bus/EXAMPLE1234567890abcdef" },
{ "Effect": "Allow", "Action": "ec2:StopInstances", "Resource": "arn:aws:ec2:ap-northeast-1:123456789012:instance/i-0123456789abcdef0" }
] }
aws iam put-role-policy \
--role-name sch-v2-scheduler-role \
--policy-name scheduler-targets \
--policy-document file://policy-scheduler.json
For Input, pass InstanceIds, the request parameter of stopInstances.
target-ec2-stop.json
{
"RoleArn": "arn:aws:iam::123456789012:role/sch-v2-scheduler-role",
"Arn": "arn:aws:scheduler:::aws-sdk:ec2:stopInstances",
"Input": "{\"InstanceIds\":[\"i-0123456789abcdef0\"]}"
}
aws scheduler create-schedule \
--name sch-v2-ec2-stop \
--schedule-expression "at(2026-11-23T12:40:00)" \
--schedule-expression-timezone Asia/Tokyo \
--flexible-time-window Mode=OFF \
--target file://target-ec2-stop.json
After the scheduled time of 12:40:00, I checked the state with the following command.
aws ec2 describe-instances \
--instance-ids i-0123456789abcdef0 \
--query 'Reservations[0].Instances[0].{InstanceId:InstanceId,State:State.Name,StateTransitionReason:StateTransitionReason}'
{
"InstanceId": "i-0123456789abcdef0",
"State": "stopping",
"StateTransitionReason": "User initiated (2026-11-23 03:40:42 GMT)"
}
The stop began at 03:40:42 GMT (12:40:42 JST), immediately after the Schedule's scheduled time. When I checked at 12:43:10, it was stopped.
Changing a Lambda Function's Reserved Concurrency
I prepared a Lambda function, sch-v2-fn, with no reserved concurrency set. The output of get-function-concurrency was empty.
aws lambda get-function-concurrency --function-name sch-v2-fn
Add the lambda:PutFunctionConcurrency permission to the execution role under a policy name separate from the events and ec2 policy.
policy-scheduler-lambda.json
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "lambda:PutFunctionConcurrency", "Resource": "arn:aws:lambda:ap-northeast-1:123456789012:function:sch-v2-fn" } ] }
aws iam put-role-policy \
--role-name sch-v2-scheduler-role \
--policy-name put-concurrency \
--policy-document file://policy-scheduler-lambda.json
Create a Schedule that sets the reserved concurrency to 5, followed by a Schedule that sets it to 2.
target-lambda-concurrency-5.json
{"RoleArn":"arn:aws:iam::123456789012:role/sch-v2-scheduler-role","Arn":"arn:aws:scheduler:::aws-sdk:lambda:putFunctionConcurrency","Input":"{\"FunctionName\":\"sch-v2-fn\",\"ReservedConcurrentExecutions\":5}"}
target-lambda-concurrency-2.json is the same with ReservedConcurrentExecutions in Input set to 2.
aws scheduler create-schedule \
--name sch-v2-conc-5 \
--schedule-expression "at(2026-11-23T12:59:00)" \
--schedule-expression-timezone Asia/Tokyo \
--flexible-time-window Mode=OFF \
--target file://target-lambda-concurrency-5.json
aws scheduler create-schedule \
--name sch-v2-conc-2 \
--schedule-expression "at(2026-11-23T13:01:00)" \
--schedule-expression-timezone Asia/Tokyo \
--flexible-time-window Mode=OFF \
--target file://target-lambda-concurrency-2.json
After the 12:59:00 Schedule, when I ran get-function-concurrency at 12:59:50, the reserved concurrency was 5.
{
"ReservedConcurrentExecutions": 5
}
After the 13:01:00 Schedule, when I ran it at 13:01:50, it was 2.
{
"ReservedConcurrentExecutions": 2
}
Summary
From EventBridge Scheduler, I was able to deliver events to the new custom event bus, and to stop an EC2 instance and change a Lambda setting through AWS SDK integrations.
When you send to the new custom event bus with PutRawEvents, Input reaches the receiving side as is, so you can write things like input references in Step Functions JSONata more concisely.
With APIs that support AWS SDK integrations, you can make configuration changes without implementing a Lambda function.
If you struggle with your job environment or with maintaining elaborate Lambda functions, give this update a try.
