[{"data":1,"prerenderedAt":31},["ShallowReactive",2],{"snippet-eventbridge-query-schedules":3},{"id":4,"title":5,"contributors":6,"description":8,"extension":9,"gitHub":10,"introBox":13,"languages":17,"meta":19,"resources":20,"services":21,"snippets":23,"stem":27,"tags":28,"type":29,"__hash__":30},"snippets\u002Fsnippets\u002Feventbridge-query-schedules.json","EventBridge Schedule Finder",[7],"content\u002Fcontributors\u002Farchana-v.json","An interactive CLI command that prompts user inputs to query and find existing EventBridge Scheduler schedules. Supports filtering by schedule name, name prefix, state, group name, and AWS region","json",{"template":11},{"repoURL":12},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-snippets\u002Ftree\u002Fmain\u002Feventbridge-query-schedules",{"headline":14,"text":15},"How it works",[16],"This interactive CLI script prompts the user for optional inputs like Schedule Name, Prefix, State, Group and Region. It dynamically builds the appropriate AWS CLI command using 'get-schedule' for exact lookups or 'list-schedules' for filtered searches. If no filters are provided, it lists all schedules in the specified region.",[18],"bash",{},null,[22],"eventbridge",[24],{"title":25,"language":18,"code":26},"Copy and paste the snippet into your terminal and enter the optional inputs","echo -n \"Schedule Name (or Enter to skip): \" && read NAME && \\\necho -n \"Name Prefix (or Enter to skip): \" && read PREFIX && \\\necho -n \"State [ENABLED\u002FDISABLED\u002FEnter to skip]: \" && read STATE && \\\necho -n \"Group Name (or Enter to skip): \" && read GROUP && \\\necho -n \"Region [us-east-1]: \" && read REGION && \\\nREGION=${REGION:-us-east-1} && \\\nCMD=\"\" && \\\nif [ -n \"$NAME\" ] && [ -z \"$STATE\" ]; then \\\n  CMD=\"aws scheduler get-schedule --name $NAME --region $REGION\"; \\\n  [ -n \"$GROUP\" ] && CMD=\"$CMD --group-name $GROUP\"; \\\n  CMD=\"$CMD --query '{Name:Name,State:State,Expression:ScheduleExpression,Group:GroupName,TargetArn:Target.Arn,Description:Description}' --output table\"; \\\nelif [ -n \"$NAME\" ] && [ -n \"$STATE\" ]; then \\\n  CMD=\"aws scheduler list-schedules --region $REGION --name-prefix $NAME --state $STATE\"; \\\n  [ -n \"$GROUP\" ] && CMD=\"$CMD --group-name $GROUP\"; \\\n  CMD=\"$CMD --query 'Schedules[?Name==\\`$NAME\\`].[Name,State,ScheduleExpression,GroupName,Target.Arn]' --output table\"; \\\nelse \\\n  CMD=\"aws scheduler list-schedules --region $REGION\"; \\\n  [ -n \"$PREFIX\" ] && CMD=\"$CMD --name-prefix $PREFIX\"; \\\n  [ -n \"$STATE\" ] && CMD=\"$CMD --state $STATE\"; \\\n  [ -n \"$GROUP\" ] && CMD=\"$CMD --group-name $GROUP\"; \\\n  CMD=\"$CMD --query 'Schedules[].[Name,State,ScheduleExpression,GroupName,Target.Arn]' --output table\"; \\\nfi && \\\necho \"Running: $CMD\" && \\\neval $CMD","snippets\u002Feventbridge-query-schedules",[],"AWS CLI","Q97Akid5eNN4JIJJQxZnRfxqjYLQEUZ_S3oAEXU9CLs",1792665262998]