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, passed to the target of the schedule.
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, it is possible to embed ContextAttributes and other cdk references. |
static from | 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. |
bind(schedule)
public bind(schedule: ISchedule): string
Parameters
- schedule
ISchedule
Returns
string
Return the input properties for this input object.
Object(obj)
static frompublic 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, it is possible to embed ContextAttributes
and other cdk references.
Text(text)
static frompublic static fromText(text: string): ScheduleTargetInput
Parameters
- text
string
โ Text to use as the input for the target.
Returns
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.