Bootstrap FreeKB - Amazon Web Services (AWS) - List EventBridge Schedules using the AWS CLI
Amazon Web Services (AWS) - List EventBridge Schedules using the AWS CLI

Updated:   |  Amazon Web Services (AWS) articles

If you are not familiar with Amazon Web Services (AWS) EventBridge Scheduler, check out my article Schedule reoccurring Lambda Function using EventBridge Scheduler.

This assumes you have already configured the aws command line tool. If not, check out my article on Getting Started with the AWS CLI.

The aws scheduler list-schedules command can be used to list the EventBridge Schedule you have created.

aws scheduler list-schedules

 

And here is an example of how to limit the output using the --query option.

aws scheduler list-schedules --query 'Schedules[?Name==`my_schedule`]'

 

Something like this should be returned.

[
    {
        "Arn": "arn:aws:scheduler:us-east-1:123456789012:schedule/default/my_schedule",
        "CreationDate": "2024-07-12T20:15:30.732000-05:00",
        "GroupName": "default",
        "LastModificationDate": "2024-07-12T20:17:53.897000-05:00",
        "Name": "my_schedule",
        "State": "ENABLED",
        "Target": {
            "Arn": "arn:aws:lambda:us-east-1:123456789012:function:my_lambda_function"
        }
    }
]

 

The aws scheduler get-schedule command can be used to display more information about a schedule.

~]$ aws scheduler get-schedule --name Replace_Furnace_Filter
{
    "Arn": "arn:aws:scheduler:us-east-1:123456789012:schedule/default/my_schedule",
    "CreationDate": "2024-07-12T20:15:30.732000-05:00",
    "Description": "",
    "FlexibleTimeWindow": {
        "Mode": "OFF"
    },
    "GroupName": "default",
    "LastModificationDate": "2024-07-12T20:17:53.897000-05:00",
    "Name": "my_schedule",
    "ScheduleExpression": "cron(00 08 1 3,6,9,12 ? *)",
    "ScheduleExpressionTimezone": "America/Chicago",
    "State": "ENABLED",
    "Target": {
        "Arn": "arn:aws:lambda:us-east-1:123456789012:function:my_lambda_function",
        "Input": "{\n    \"foo\":\"Hellow\",\n    \"bar\":\"World\"\n}",
        "RetryPolicy": {
            "MaximumEventAgeInSeconds": 86400,
            "MaximumRetryAttempts": 185
        },
        "RoleArn": "arn:aws:iam::123456789012:role/service-role/Amazon_EventBridge_Scheduler_LAMBDA_my_schedule"
    }
}

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter fa9654 in the box below so that we can be sure you are a human.