class ScheduleTargetInput
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Scheduler.Alpha.ScheduleTargetInput |
Go | github.com/aws/aws-cdk-go/awscdkscheduleralpha/v2#ScheduleTargetInput |
Java | software.amazon.awscdk.services.scheduler.alpha.ScheduleTargetInput |
Python | aws_cdk.aws_scheduler_alpha.ScheduleTargetInput |
TypeScript (source) | @aws-cdk/aws-scheduler-alpha ยป ScheduleTargetInput |
The text or well-formed JSON input passed to the target of the schedule.
Tokens and ContextAttribute may be used in the input.
Example
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
new ScheduleTargetInput()
Methods
Name | Description |
---|---|
bind(schedule) | Return the input properties for this input object. |
static from | Pass a JSON object to the target. |
static from | Pass simple text to the target. |
bind(schedule)
public bind(schedule: ISchedule): string
Parameters
- schedule
ISchedule
Returns
string
Return the input properties for this input object.
static fromObject(obj)
public static fromObject(obj: any): ScheduleTargetInput
Parameters
- obj
any
โ object to use to convert to JSON to use as input for the target.
Returns
Pass a JSON object to the target.
The object will be transformed into a well-formed JSON string in the final template.
static fromText(text)
public static fromText(text: string): ScheduleTargetInput
Parameters
- text
string
โ Text to use as the input for the target.
Returns
Pass simple text to the target.
For passing complex values like JSON object to a target use method
ScheduleTargetInput.fromObject()
instead.