EventBridgeSchedulerCreateScheduleTaskProps
- class aws_cdk.aws_stepfunctions_tasks.EventBridgeSchedulerCreateScheduleTaskProps(*, comment=None, credentials=None, heartbeat=None, heartbeat_timeout=None, input_path=None, integration_pattern=None, output_path=None, result_path=None, result_selector=None, state_name=None, task_timeout=None, timeout=None, schedule, schedule_name, target, action_after_completion=None, client_token=None, description=None, enabled=None, end_date=None, flexible_time_window=None, group_name=None, kms_key=None, start_date=None, timezone=None)
Bases:
TaskStateBaseProps
Properties for creating an AWS EventBridge Scheduler schedule.
- Parameters:
comment (
Optional
[str
]) – An optional description for this state. Default: - No commentcredentials (
Union
[Credentials
,Dict
[str
,Any
],None
]) – Credentials for an IAM Role that the State Machine assumes for executing the task. This enables cross-account resource invocations. Default: - None (Task is executed using the State Machine’s execution role)heartbeat (
Optional
[Duration
]) – (deprecated) Timeout for the heartbeat. Default: - Noneheartbeat_timeout (
Optional
[Timeout
]) – Timeout for the heartbeat. [disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface Default: - Noneinput_path (
Optional
[str
]) – JSONPath expression to select part of the state to be the input to this state. May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}. Default: - The entire task input (JSON path ‘$’)integration_pattern (
Optional
[IntegrationPattern
]) – AWS Step Functions integrates with services directly in the Amazon States Language. You can control these AWS services using service integration patterns. Depending on the AWS Service, the Service Integration Pattern availability will vary. Default: -IntegrationPattern.REQUEST_RESPONSE
for most tasks.IntegrationPattern.RUN_JOB
for the following exceptions:BatchSubmitJob
,EmrAddStep
,EmrCreateCluster
,EmrTerminationCluster
, andEmrContainersStartJobRun
.output_path (
Optional
[str
]) – JSONPath expression to select select a portion of the state output to pass to the next state. May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}. Default: - The entire JSON node determined by the state input, the task result, and resultPath is passed to the next state (JSON path ‘$’)result_path (
Optional
[str
]) – JSONPath expression to indicate where to inject the state’s output. May also be the special value JsonPath.DISCARD, which will cause the state’s input to become its output. Default: - Replaces the entire input with the result (JSON path ‘$’)result_selector (
Optional
[Mapping
[str
,Any
]]) – The JSON that will replace the state’s raw result and become the effective result before ResultPath is applied. You can use ResultSelector to create a payload with values that are static or selected from the state’s raw result. Default: - Nonestate_name (
Optional
[str
]) – Optional name for this state. Default: - The construct ID will be used as state nametask_timeout (
Optional
[Timeout
]) – Timeout for the task. [disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface Default: - Nonetimeout (
Optional
[Duration
]) – (deprecated) Timeout for the task. Default: - Noneschedule (
Schedule
) – The schedule that defines when the schedule will trigger.schedule_name (
str
) – Schedule name.target (
EventBridgeSchedulerTarget
) – The schedule’s target.action_after_completion (
Optional
[ActionAfterCompletion
]) – Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target. Default: ActionAfterCompletion.NONEclient_token (
Optional
[str
]) – Unique, case-sensitive identifier to ensure the idempotency of the request. Default: - Automatically generateddescription (
Optional
[str
]) – The description for the schedule. Default: - No descriptionenabled (
Optional
[bool
]) – Specifies whether the schedule is enabled or disabled. Default: trueend_date (
Optional
[datetime
]) – The date, in UTC, before which the schedule can invoke its target. Depending on the schedule’s recurrence expression, invocations might stop on, or before, the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time schedules. Default: - No end dateflexible_time_window (
Optional
[Duration
]) – The maximum time window during which a schedule can be invoked. Minimum value is 1 minute. Maximum value is 1440 minutes (1 day). Default: - Flexible time window is not enabled.group_name (
Optional
[str
]) – The name of the schedule group to associate with this schedule. Default: - The default schedule group is used.kms_key (
Optional
[IKey
]) – The customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt payload. Default: - Use automatically generated KMS keystart_date (
Optional
[datetime
]) – The date, in UTC, after which the schedule can begin invoking its target. Depending on the schedule’s recurrence expression, invocations might occur on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for one-time schedules. Default: - No start datetimezone (
Optional
[str
]) – The timezone in which the scheduling expression is evaluated. Default: - UTC
- 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
- action_after_completion
Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.
- Default:
ActionAfterCompletion.NONE
- client_token
Unique, case-sensitive identifier to ensure the idempotency of the request.
- Default:
Automatically generated
- comment
An optional description for this state.
- Default:
No comment
- credentials
Credentials for an IAM Role that the State Machine assumes for executing the task.
This enables cross-account resource invocations.
- Default:
None (Task is executed using the State Machine’s execution role)
- See:
- description
The description for the schedule.
- Default:
No description
- enabled
Specifies whether the schedule is enabled or disabled.
- Default:
true
- end_date
The date, in UTC, before which the schedule can invoke its target.
Depending on the schedule’s recurrence expression, invocations might stop on, or before, the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time schedules.
- Default:
No end date
- flexible_time_window
The maximum time window during which a schedule can be invoked.
Minimum value is 1 minute. Maximum value is 1440 minutes (1 day).
- Default:
Flexible time window is not enabled.
- group_name
The name of the schedule group to associate with this schedule.
- Default:
The default schedule group is used.
- heartbeat
(deprecated) Timeout for the heartbeat.
- Default:
None
- Deprecated:
use
heartbeatTimeout
- Stability:
deprecated
- heartbeat_timeout
Timeout for the heartbeat.
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
- Default:
None
- input_path
JSONPath expression to select part of the state to be the input to this state.
May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.
- Default:
The entire task input (JSON path ‘$’)
- integration_pattern
AWS Step Functions integrates with services directly in the Amazon States Language.
You can control these AWS services using service integration patterns.
Depending on the AWS Service, the Service Integration Pattern availability will vary.
- Default:
IntegrationPattern.REQUEST_RESPONSE
for most tasks.
IntegrationPattern.RUN_JOB
for the following exceptions:BatchSubmitJob
,EmrAddStep
,EmrCreateCluster
,EmrTerminationCluster
, andEmrContainersStartJobRun
.
- kms_key
The customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt payload.
- Default:
Use automatically generated KMS key
- See:
https://docs.aws.amazon.com/scheduler/latest/UserGuide/encryption-rest.html
- output_path
JSONPath expression to select select a portion of the state output to pass to the next state.
May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.
- Default:
The entire JSON node determined by the state input, the task result,
and resultPath is passed to the next state (JSON path ‘$’)
- result_path
JSONPath expression to indicate where to inject the state’s output.
May also be the special value JsonPath.DISCARD, which will cause the state’s input to become its output.
- Default:
Replaces the entire input with the result (JSON path ‘$’)
- result_selector
The JSON that will replace the state’s raw result and become the effective result before ResultPath is applied.
You can use ResultSelector to create a payload with values that are static or selected from the state’s raw result.
- schedule
The schedule that defines when the schedule will trigger.
- schedule_name
Schedule name.
- start_date
The date, in UTC, after which the schedule can begin invoking its target.
Depending on the schedule’s recurrence expression, invocations might occur on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for one-time schedules.
- Default:
No start date
- state_name
Optional name for this state.
- Default:
The construct ID will be used as state name
- target
The schedule’s target.
- task_timeout
Timeout for the task.
[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface
- Default:
None
- timeout
(deprecated) Timeout for the task.
- Default:
None
- Deprecated:
use
taskTimeout
- Stability:
deprecated
- timezone
The timezone in which the scheduling expression is evaluated.
- Default:
UTC