Skip to content
v2.273.0

ScheduleTargetInput Class ​

The text or well-formed JSON input passed to the target of the schedule.

Tokens and ContextAttribute may be used in the input.

Example ​

ts
import * as sns from 'aws-cdk-lib/aws-sns';

const topic = new sns.Topic(this, 'Topic');

const payload = {
  message: 'Hello scheduler!',
};

const target = new targets.SnsPublish(topic, {
  input: ScheduleTargetInput.fromObject(payload),
});

new Schedule(this, 'Schedule', {
  schedule: ScheduleExpression.rate(Duration.hours(1)),
  target,
});

Initializer ​

ts
new ScheduleTargetInput()
python
ScheduleTargetInput()
java
new ScheduleTargetInput()
csharp
new ScheduleTargetInput()
go
NewScheduleTargetInput()

Methods ​

bind(schedule: ISchedule): stringdef bind(self, schedule: ISchedule) -> strpublic String bind(ISchedule schedule)public string Bind(ISchedule schedule)func Bind(Schedule ISchedule) *string#
Return the input properties for this input object.
fromObject(obj: any): ScheduleTargetInput // chainable@staticmethod def from_object(obj: Any) -> ScheduleTargetInputpublic static ScheduleTargetInput fromObject(Object obj)public static ScheduleTargetInput FromObject(object obj)func FromObject(Obj interface{}) ScheduleTargetInputstatic#
Pass a JSON object to the target.

The object will be transformed into a well-formed JSON string in the final template.

1 parameter

Parameters

  • objobjobjobjObj — object to use to convert to JSON to use as input for the target.
fromText(text: string): ScheduleTargetInput // chainable@staticmethod def from_text(text: str) -> ScheduleTargetInputpublic static ScheduleTargetInput fromText(String text)public static ScheduleTargetInput FromText(string text)func FromText(Text *string) ScheduleTargetInputstatic#
Pass simple text to the target.

For passing complex values like JSON object to a target use method ScheduleTargetInput.fromObject() instead.

1 parameter

Parameters

  • texttexttexttextText — Text to use as the input for the target.