Skip to content
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

CloudWatch events: multi-line target input template is broken #1514

Closed
RomainMuller opened this issue Jan 10, 2019 · 1 comment · Fixed by #1570
Closed

CloudWatch events: multi-line target input template is broken #1514

RomainMuller opened this issue Jan 10, 2019 · 1 comment · Fixed by #1570
Labels
@aws-cdk/aws-events Related to CloudWatch Events bug This issue is a bug.

Comments

@RomainMuller
Copy link
Contributor

When using textTemplate, the TargetInputTemplate tries to quote and escape the template, however when the template is multi-line, the quoting has to be different. This makes the multiline template invalid & unusable.

A (dirty) workaround is to use jsonTemplate instead, which will not incur any quoting and escaping action.

@RomainMuller RomainMuller added bug This issue is a bug. @aws-cdk/aws-events Related to CloudWatch Events labels Jan 10, 2019
rix0rrr added a commit that referenced this issue Jan 18, 2019
Support newlines in CloudWatch Events textTemplate as intended, by
making a newline-separated list of JSON strings.

Fixes #1514.
rix0rrr added a commit that referenced this issue Jan 22, 2019
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.
sam-goodwin pushed a commit that referenced this issue Jan 28, 2019
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.
@coolprasanth
Copy link

When using textTemplate, the TargetInputTemplate tries to quote and escape the template, however when the template is multi-line, the quoting has to be different. This makes the multiline template invalid & unusable.

A (dirty) workaround is to use jsonTemplate instead, which will not incur any quoting and escaping action.

Just the thing I was looking for. But I'm not sure what you mean by jsonTemplate. Can you please give some details/reference for it.

Regards
Prasanth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-events Related to CloudWatch Events bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants