class RuleTargetInput
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Events.RuleTargetInput |
Java | software.amazon.awscdk.services.events.RuleTargetInput |
Python | aws_cdk.aws_events.RuleTargetInput |
TypeScript (source) | @aws-cdk/aws-events » RuleTargetInput |
The input to send to the event target.
Example
import * as iam from '@aws-cdk/aws-iam';
import * as sfn from '@aws-cdk/aws-stepfunctions';
const rule = new events.Rule(this, 'Rule', {
schedule: events.Schedule.rate(cdk.Duration.minutes(1)),
});
const dlq = new sqs.Queue(this, 'DeadLetterQueue');
const role = new iam.Role(this, 'Role', {
assumedBy: new iam.ServicePrincipal('events.amazonaws.com'),
});
const stateMachine = new sfn.StateMachine(this, 'SM', {
definition: new sfn.Wait(this, 'Hello', { time: sfn.WaitTime.duration(cdk.Duration.seconds(10)) })
});
rule.addTarget(new targets.SfnStateMachine(stateMachine, {
input: events.RuleTargetInput.fromObject({ SomeParam: 'SomeValue' }),
deadLetterQueue: dlq,
role: role
}));
Initializer
new RuleTargetInput()
Methods
Name | Description |
---|---|
bind(rule) | Return the input properties for this input object. |
static from | Take the event target input from a path in the event JSON. |
static from | Pass text to the event target, splitting on newlines. |
static from | Pass a JSON object to the event target. |
static from | Pass text to the event target. |
bind(rule)
public bind(rule: IRule): RuleTargetInputProperties
Parameters
- rule
IRule
Returns
Return the input properties for this input object.
EventPath(path)
static frompublic static fromEventPath(path: string): RuleTargetInput
Parameters
- path
string
Returns
Take the event target input from a path in the event JSON.
MultilineText(text)
static frompublic static fromMultilineText(text: string): RuleTargetInput
Parameters
- text
string
Returns
Pass text to the event target, splitting on newlines.
This is only useful when passing to a target that does not take a single argument.
May contain strings returned by EventField.from()
to substitute in parts
of the matched event.
Object(obj)
static frompublic static fromObject(obj: any): RuleTargetInput
Parameters
- obj
any
Returns
Pass a JSON object to the event target.
May contain strings returned by EventField.from()
to substitute in parts of the
matched event.
Text(text)
static frompublic static fromText(text: string): RuleTargetInput
Parameters
- text
string
Returns
Pass text to the event target.
May contain strings returned by EventField.from()
to substitute in parts of the
matched event.
The Rule Target input value will be a single string: the string you pass
here. Do not use this method to pass a complex value like a JSON object to
a Rule Target. Use RuleTargetInput.fromObject()
instead.