-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow fixed string input to CW Event #1198
Comments
I'm not 100% up to date on this API, but looking at it, wouldn't the following work? const rule = new Rule(this, 'Rule', { ... });
const stateMachine = new StateMachine(this, 'SM', { ... });
rule.addTargeT(stateMachine, {
jsonTemplate: {
NotebookName: props.notebookName,
EmailAddress: props.emailAddress,
},
}); If not, why not? |
I tried this but it gave me the following error:
I think it is because it is trying to fill in the |
const rule = new Rule(this, 'Rule', { ... });
const stateMachine = new StateMachine(this, 'SM', { ... });
rule.addTarget(stateMachine, {
jsonTemplate: JSON.stringify({
NotebookName: props.notebookName,
EmailAddress: props.emailAddress,
}),
}); |
I have tried this out and it works fine. Thanks! |
Reopening, we should change the type of |
They will be JSONified automatically. Fixes #1198.
Fixes the following things for CloudWatch events: * Support newlines in CloudWatch Events textTemplate as intended, by making a newline-separated list of JSON strings. Fixes #1514. * `jsonTemplate` now accepts arbitrary objects. They will be JSONified automatically. Fixes #1198. * Explicitly implement `IEventRuleTarget` on stepfunctions StateMachine so that Java/.NET users can trigger StateMachines using CloudWatch Events. Fixes part of #1275.
Fixes the following things for CloudWatch events: * Support newlines in CloudWatch Events textTemplate as intended, by making a newline-separated list of JSON strings. Fixes #1514. * `jsonTemplate` now accepts arbitrary objects. They will be JSONified automatically. Fixes #1198. * Explicitly implement `IEventRuleTarget` on stepfunctions StateMachine so that Java/.NET users can trigger StateMachines using CloudWatch Events. Fixes part of #1275.
I would like to use CDK to trigger the execution of a Step Function state machine on a periodic basis. Step functions can take input provided by the CloudWatch event however it seems that the Event resource only modifies the event object via a template rather than provide a static JSON text as the input field.
Today I have had to use the underlying cloudformation resources to do this with the "input" field. Would be nice to be able to do this with the L2 construct for Event.
The text was updated successfully, but these errors were encountered: