class SnsPublish
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Scheduler.Targets.Alpha.SnsPublish |
Go | github.com/aws/aws-cdk-go/awscdkschedulertargetsalpha/v2#SnsPublish |
Java | software.amazon.awscdk.services.scheduler.targets.alpha.SnsPublish |
Python | aws_cdk.aws_scheduler_targets_alpha.SnsPublish |
TypeScript (source) | @aws-cdk/aws-scheduler-targets-alpha » SnsPublish |
Implements
ISchedule
Extends
Schedule
Use an Amazon SNS topic as a target for AWS EventBridge Scheduler.
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 SnsPublish(topic: ITopic, props?: ScheduleTargetBaseProps)
Parameters
- topic
ITopic
- props
Schedule
Target Base Props
Methods
Name | Description |
---|---|
bind(schedule) | Create a return a Schedule Target Configuration for the given schedule. |
protected add |
bind(schedule)
public bind(schedule: ISchedule): ScheduleTargetConfig
Parameters
- schedule
ISchedule
Returns
Create a return a Schedule Target Configuration for the given schedule.
TargetActionToRole(role)
protected addprotected addTargetActionToRole(role: IRole): void
Parameters
- role
IRole