Class EventBridgeSchedulerTarget

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.tasks.EventBridgeSchedulerTarget
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:10.385Z") @Stability(Stable) public class EventBridgeSchedulerTarget extends software.amazon.jsii.JsiiObject
The target that EventBridge Scheduler will invoke.

Example:

 import software.amazon.awscdk.services.scheduler.*;
 import software.amazon.awscdk.services.kms.*;
 Key key;
 CfnScheduleGroup scheduleGroup;
 Queue targetQueue;
 Queue deadLetterQueue;
 Role schedulerRole = Role.Builder.create(this, "SchedulerRole")
         .assumedBy(new ServicePrincipal("scheduler.amazonaws.com"))
         .build();
 // To send the message to the queue
 // This policy changes depending on the type of target.
 schedulerRole.addToPrincipalPolicy(PolicyStatement.Builder.create()
         .actions(List.of("sqs:SendMessage"))
         .resources(List.of(targetQueue.getQueueArn()))
         .build());
 EventBridgeSchedulerCreateScheduleTask createScheduleTask1 = EventBridgeSchedulerCreateScheduleTask.Builder.create(this, "createSchedule")
         .scheduleName("TestSchedule")
         .actionAfterCompletion(ActionAfterCompletion.NONE)
         .clientToken("testToken")
         .description("TestDescription")
         .startDate(new Date())
         .endDate(new Date(new Date().getTime() + 1000 * 60 * 60))
         .flexibleTimeWindow(Duration.minutes(5))
         .groupName(scheduleGroup.getRef())
         .kmsKey(key)
         .schedule(Schedule.rate(Duration.minutes(5)))
         .timezone("UTC")
         .enabled(true)
         .target(EventBridgeSchedulerTarget.Builder.create()
                 .arn(targetQueue.getQueueArn())
                 .role(schedulerRole)
                 .retryPolicy(RetryPolicy.builder()
                         .maximumRetryAttempts(2)
                         .maximumEventAge(Duration.minutes(5))
                         .build())
                 .deadLetterQueue(deadLetterQueue)
                 .build())
         .build();
 
  • Constructor Details

    • EventBridgeSchedulerTarget

      protected EventBridgeSchedulerTarget(software.amazon.jsii.JsiiObjectRef objRef)
    • EventBridgeSchedulerTarget

      protected EventBridgeSchedulerTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • EventBridgeSchedulerTarget

      @Stability(Stable) public EventBridgeSchedulerTarget(@NotNull EventBridgeSchedulerTargetProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • renderTargetObject

      @Stability(Stable) @NotNull public Object renderTargetObject()
      return the target object for the EventBridge Scheduler.
    • getArn

      @Stability(Stable) @NotNull public String getArn()
      The Amazon Resource Name (ARN) of the target.
    • setArn

      @Stability(Stable) public void setArn(@NotNull String value)
      The Amazon Resource Name (ARN) of the target.
    • getRole

      @Stability(Stable) @NotNull public IRole getRole()
      The IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.
    • setRole

      @Stability(Stable) public void setRole(@NotNull IRole value)
      The IAM role that EventBridge Scheduler will use for this target when the schedule is invoked.
    • getDeadLetterQueue

      @Stability(Stable) @Nullable public IQueue getDeadLetterQueue()
      Dead letter queue for failed events.
    • setDeadLetterQueue

      @Stability(Stable) public void setDeadLetterQueue(@Nullable IQueue value)
      Dead letter queue for failed events.
    • getInput

      @Stability(Stable) @Nullable public String getInput()
      The input to the target.
    • setInput

      @Stability(Stable) public void setInput(@Nullable String value)
      The input to the target.
    • getRetryPolicy

      @Stability(Stable) @Nullable public RetryPolicy getRetryPolicy()
      The retry policy settings.
    • setRetryPolicy

      @Stability(Stable) public void setRetryPolicy(@Nullable RetryPolicy value)
      The retry policy settings.