-
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): ergonomics improvements to CloudWatch Events (#1570)
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.
- Loading branch information
Showing
7 changed files
with
190 additions
and
9 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
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