-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(aws-events): support newlines in textTemplate
Support newlines in CloudWatch Events textTemplate as intended, by making a newline-separated list of JSON strings. Fixes #1514.
- Loading branch information
Showing
5 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"app": "node index" | ||
} |
25 changes: 25 additions & 0 deletions
25
examples/cdk-examples-typescript/cloudwatch-events/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import events = require('@aws-cdk/aws-events'); | ||
import sns = require('@aws-cdk/aws-sns'); | ||
import cdk = require('@aws-cdk/cdk'); | ||
|
||
const app = new cdk.App(); | ||
|
||
class CloudWatchEventsExample extends cdk.Stack { | ||
constructor(scope: cdk.App, id: string) { | ||
super(scope, id); | ||
|
||
const topic = new sns.Topic(this, 'TestTopic'); | ||
|
||
const event = new events.EventRule(this, 'Rule', { | ||
scheduleExpression: 'rate(1 minute)' | ||
}); | ||
|
||
event.addTarget(topic, { | ||
textTemplate: 'one line\nsecond line' | ||
}); | ||
} | ||
} | ||
|
||
new CloudWatchEventsExample(app, 'CWE-Example'); | ||
|
||
app.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters