ScheduleTargetInput

class aws_cdk.aws_scheduler_alpha.ScheduleTargetInput

Bases: object

(experimental) The text, or well-formed JSON, passed to the target of the schedule.

Stability:

experimental

ExampleMetadata:

infused

Example:

import aws_cdk.aws_sns as sns


topic = sns.Topic(self, "Topic")

payload = {
    "message": "Hello scheduler!"
}

target = targets.SnsPublish(topic,
    input=ScheduleTargetInput.from_object(payload)
)

Schedule(self, "Schedule",
    schedule=ScheduleExpression.rate(Duration.hours(1)),
    target=target
)
Stability:

experimental

Methods

abstract bind(schedule)

(experimental) Return the input properties for this input object.

Parameters:

schedule (ISchedule) –

Stability:

experimental

Return type:

str

Static Methods

classmethod from_object(obj)

(experimental) Pass a JSON object to the target, it is possible to embed ContextAttributes and other cdk references.

Parameters:

obj (Any) – object to use to convert to JSON to use as input for the target.

Stability:

experimental

Return type:

ScheduleTargetInput

classmethod from_text(text)

(experimental) Pass text to the target, it is possible to embed ContextAttributes that will be resolved to actual values while the CloudFormation is deployed or cdk Tokens that will be resolved when the CloudFormation templates are generated by CDK.

The target input value will be a single string that you pass. For passing complex values like JSON object to a target use method ScheduleTargetInput.fromObject() instead.

Parameters:

text (str) – Text to use as the input for the target.

Stability:

experimental

Return type:

ScheduleTargetInput