Class RuleTargetInput
The input to send to the event target.
Inheritance
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class RuleTargetInput : DeputyBase
Syntax (vb)
Public MustInherit Class RuleTargetInput
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.StepFunctions;
var rule = new Rule(this, "Rule", new RuleProps {
Schedule = Schedule.Rate(Duration.Minutes(1))
});
var dlq = new Queue(this, "DeadLetterQueue");
var role = new Role(this, "Role", new RoleProps {
AssumedBy = new ServicePrincipal("events.amazonaws.com")
});
var stateMachine = new StateMachine(this, "SM", new StateMachineProps {
Definition = new Wait(this, "Hello", new WaitProps { Time = WaitTime.Duration(Duration.Seconds(10)) })
});
rule.AddTarget(new SfnStateMachine(stateMachine, new SfnStateMachineProps {
Input = RuleTargetInput.FromObject(new Dictionary<string, string> { { "SomeParam", "SomeValue" } }),
DeadLetterQueue = dlq,
Role = role
}));
Synopsis
Constructors
RuleTargetInput() | |
RuleTargetInput(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
RuleTargetInput(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(IRule) | Return the input properties for this input object. |
FromEventPath(String) | Take the event target input from a path in the event JSON. |
FromMultilineText(String) | Pass text to the event target, splitting on newlines. |
FromObject(Object) | Pass a JSON object to the event target. |
FromText(String) | Pass text to the event target. |
Constructors
RuleTargetInput()
protected RuleTargetInput()
RuleTargetInput(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected RuleTargetInput(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
RuleTargetInput(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected RuleTargetInput(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(IRule)
Return the input properties for this input object.
public abstract IRuleTargetInputProperties Bind(IRule rule)
Parameters
- rule IRule
Returns
FromEventPath(String)
Take the event target input from a path in the event JSON.
public static RuleTargetInput FromEventPath(string path)
Parameters
- path System.String
Returns
FromMultilineText(String)
Pass text to the event target, splitting on newlines.
public static RuleTargetInput FromMultilineText(string text)
Parameters
- text System.String
Returns
Remarks
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.
FromObject(Object)
Pass a JSON object to the event target.
public static RuleTargetInput FromObject(object obj)
Parameters
- obj System.Object
Returns
Remarks
May contain strings returned by EventField.from()
to substitute in parts of the
matched event.
FromText(String)
Pass text to the event target.
public static RuleTargetInput FromText(string text)
Parameters
- text System.String
Returns
Remarks
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.