|
| 1 | +# EventBridge Scheduler code examples for the SDK for Java 2.x |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Shows how to use the AWS SDK for Java 2.x to work with Amazon EventBridge Scheduler. |
| 6 | + |
| 7 | +<!--custom.overview.start--> |
| 8 | +<!--custom.overview.end--> |
| 9 | + |
| 10 | +_EventBridge Scheduler allows you to create, run, and manage tasks on a schedule from one central, managed service._ |
| 11 | + |
| 12 | +## ⚠ Important |
| 13 | + |
| 14 | +* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). |
| 15 | +* Running the tests might result in charges to your AWS account. |
| 16 | +* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). |
| 17 | +* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). |
| 18 | + |
| 19 | +<!--custom.important.start--> |
| 20 | +<!--custom.important.end--> |
| 21 | + |
| 22 | +## Code examples |
| 23 | + |
| 24 | +### Prerequisites |
| 25 | + |
| 26 | +For prerequisites, see the [README](../../README.md#Prerequisites) in the `javav2` folder. |
| 27 | + |
| 28 | + |
| 29 | +<!--custom.prerequisites.start--> |
| 30 | +<!--custom.prerequisites.end--> |
| 31 | + |
| 32 | +### Get started |
| 33 | + |
| 34 | +- [Hello EventBridge Scheduler](src/main/java/com/example/eventbrideschedule/HelloScheduler.java#L6) (`ListSchedules`) |
| 35 | + |
| 36 | + |
| 37 | +### Single actions |
| 38 | + |
| 39 | +Code excerpts that show you how to call individual service functions. |
| 40 | + |
| 41 | +- [CreateSchedule](src/main/java/com/example/eventbrideschedule/scenario/EventbridgeSchedulerActions.java#L104) |
| 42 | +- [CreateScheduleGroup](src/main/java/com/example/eventbrideschedule/scenario/EventbridgeSchedulerActions.java#L70) |
| 43 | +- [DeleteSchedule](src/main/java/com/example/eventbrideschedule/scenario/EventbridgeSchedulerActions.java#L212) |
| 44 | +- [DeleteScheduleGroup](src/main/java/com/example/eventbrideschedule/scenario/EventbridgeSchedulerActions.java#L182) |
| 45 | + |
| 46 | +### Scenarios |
| 47 | + |
| 48 | +Code examples that show you how to accomplish a specific task by calling multiple |
| 49 | +functions within the same service. |
| 50 | + |
| 51 | +- [Scheduled Events workflow](src/main/java/com/example/eventbrideschedule/scenario/EventbridgeSchedulerScenario.java) |
| 52 | + |
| 53 | + |
| 54 | +<!--custom.examples.start--> |
| 55 | +<!--custom.examples.end--> |
| 56 | + |
| 57 | +## Run the examples |
| 58 | + |
| 59 | +### Instructions |
| 60 | + |
| 61 | + |
| 62 | +<!--custom.instructions.start--> |
| 63 | +<!--custom.instructions.end--> |
| 64 | + |
| 65 | +#### Hello EventBridge Scheduler |
| 66 | + |
| 67 | +This example shows you how to get started using EventBridge Scheduler. |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +#### Scheduled Events workflow |
| 72 | + |
| 73 | +This example shows you how to do the following: |
| 74 | + |
| 75 | +- Deploy a CloudFormation stack with required resources. |
| 76 | +- Create a EventBridge Scheduler schedule group. |
| 77 | +- Create a one-time EventBridge Scheduler schedule with a flexible time window. |
| 78 | +- Create a recurring EventBridge Scheduler schedule with a specified rate. |
| 79 | +- Delete EventBridge Scheduler the schedule and schedule group. |
| 80 | +- Clean up resources and delete the stack. |
| 81 | + |
| 82 | +<!--custom.scenario_prereqs.scheduler_ScheduledEventsWorkflow.start--> |
| 83 | +<!--custom.scenario_prereqs.scheduler_ScheduledEventsWorkflow.end--> |
| 84 | + |
| 85 | + |
| 86 | +<!--custom.scenarios.scheduler_ScheduledEventsWorkflow.start--> |
| 87 | +<!--custom.scenarios.scheduler_ScheduledEventsWorkflow.end--> |
| 88 | + |
| 89 | +### Tests |
| 90 | + |
| 91 | +⚠ Running tests might result in charges to your AWS account. |
| 92 | + |
| 93 | + |
| 94 | +To find instructions for running these tests, see the [README](../../README.md#Tests) |
| 95 | +in the `javav2` folder. |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | +<!--custom.tests.start--> |
| 100 | +<!--custom.tests.end--> |
| 101 | + |
| 102 | +## Additional resources |
| 103 | + |
| 104 | +- [EventBridge Scheduler User Guide](https://docs.aws.amazon.com/scheduler/latest/userguide/intro.html) |
| 105 | +- [EventBridge Scheduler API Reference](https://docs.aws.amazon.com/scheduler/latest/apireference/Welcome.html) |
| 106 | +- [SDK for Java 2.x EventBridge Scheduler reference](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/firehose/package-summary.html) |
| 107 | + |
| 108 | +<!--custom.resources.start--> |
| 109 | +<!--custom.resources.end--> |
| 110 | + |
| 111 | +--- |
| 112 | + |
| 113 | +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 114 | + |
| 115 | +SPDX-License-Identifier: Apache-2.0 |
0 commit comments