ActionAfterCompletion

class aws_cdk.aws_stepfunctions_tasks.ActionAfterCompletion(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

The action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_scheduler as scheduler
import aws_cdk.aws_kms as kms

# key: kms.Key
# schedule_group: scheduler.CfnScheduleGroup
# target_queue: sqs.Queue
# dead_letter_queue: sqs.Queue


scheduler_role = iam.Role(self, "SchedulerRole",
    assumed_by=iam.ServicePrincipal("scheduler.amazonaws.com")
)
# To send the message to the queue
# This policy changes depending on the type of target.
scheduler_role.add_to_principal_policy(iam.PolicyStatement(
    actions=["sqs:SendMessage"],
    resources=[target_queue.queue_arn]
))

create_schedule_task1 = tasks.EventBridgeSchedulerCreateScheduleTask(self, "createSchedule",
    schedule_name="TestSchedule",
    action_after_completion=tasks.ActionAfterCompletion.NONE,
    client_token="testToken",
    description="TestDescription",
    start_date=Date(),
    end_date=Date(Date().get_time() + 1000 * 60 * 60),
    flexible_time_window=Duration.minutes(5),
    group_name=schedule_group.ref,
    kms_key=key,
    schedule=tasks.Schedule.rate(Duration.minutes(5)),
    timezone="UTC",
    enabled=True,
    target=tasks.EventBridgeSchedulerTarget(
        arn=target_queue.queue_arn,
        role=scheduler_role,
        retry_policy=tasks.RetryPolicy(
            maximum_retry_attempts=2,
            maximum_event_age=Duration.minutes(5)
        ),
        dead_letter_queue=dead_letter_queue
    )
)

Attributes

DELETE

Deletes the schedule.

NONE

Takes no action.