Create and Organize Schedules Using Schedule Groups with AWS CLI

Use AWS CLI to create Amazon EventBridge Scheduler schedule groups to organize and manage schedules, including creating groups with tags, adding schedules to groups, listing, and cleaning up

This snippet demonstrates how to create and organize Amazon EventBridge Scheduler schedules using schedule groups via the AWS CLI. Schedule groups allow you to organize schedules by project, environment, or team using aws scheduler create-schedule-group with tags, then associate schedules to groups using the --group-name parameter. You can list groups and their schedules, and clean up by deleting schedules and groups.

Create a schedule group with tags and add a schedule to it. Replace LAMBDA_ARN and EVENTBRIDGE_ROLE_ARN with your values

aws scheduler create-schedule-group \
  --name "my-schedule-group" \
  --tags Key=Environment,Value=Production Key=Team,Value=Backend

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


Created by:

Sahithi Ginjupalli

Sahithi Ginjupalli

Sahithi Ginjupalli is a Cloud Engineer with a passion for continuous learning and in-depth exploration of her field. She helps optimize client applications through strategic implementation of AWS services, enhancing their efficiency and performance.

Follow on LinkedIn