Create EventBridge Scheduler Schedules Using AWS CLI

Use AWS CLI to create Amazon EventBridge Scheduler schedules with rate and cron expressions targeting AWS Lambda

This snippet demonstrates how to create Amazon EventBridge Scheduler schedules using the AWS CLI aws scheduler create-schedule command with rate and cron expressions, targeting AWS Lambda

Cron expression schedule

aws scheduler create-schedule \
  --name "my-cron-schedule" \
  --schedule-expression "cron(0 9 * * ? *)" \
  --target '{
    "Arn": "<LAMBDA_ARN>",
    "RoleArn": "<EVENTBRIDGE_ROLE_ARN>"
  }' \
  --flexible-time-window '{"Mode": "OFF"}'
                                


Rate expression schedule

aws scheduler create-schedule \
  --name "my-rate-schedule" \
  --schedule-expression "rate(5 minutes)" \
  --target '{
    "Arn": "<LAMBDA_ARN>",
    "RoleArn": "<EVENTBRIDGE_ROLE_ARN>"
  }' \
  --flexible-time-window '{"Mode": "OFF"}'
                                


Created by:

Archana V

Archana V

Solutions Architect at AWS

Follow on LinkedIn