Skip to content

Commit 18c6bb3

Browse files
authored
chore(docs): add more info about available actions in README (#635)
--- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent b2f9e5d commit 18c6bb3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ export class MonitoringStack extends DeploymentStack {
140140

141141
### Customize actions
142142

143-
Alarms should have an action setup, otherwise they are not very useful. Currently, we support notifying an SNS topic.
143+
Alarms should have actions set up, otherwise they are not very useful.
144+
145+
Example of notifying an SNS topic:
144146

145147
```ts
146-
const onAlarmTopic = new Topic(this, "AlarmTopic");
148+
declare const onAlarmTopic: ITopic;
147149

148150
const monitoring = new MonitoringFacade(this, "Monitoring", {
149151
// ...other props
@@ -169,6 +171,17 @@ monitoring
169171
});
170172
```
171173

174+
Supported actions can be found [here](https://github.com/cdklabs/cdk-monitoring-constructs/tree/main/lib/common/alarm/action), including SNS and Lambda.
175+
176+
You can also compose multiple actions using `multipleActions`:
177+
178+
```ts
179+
declare const onAlarmTopic: ITopic;
180+
declare const onAlarmFunction: IFunction;
181+
182+
const action: IAlarmActionStrategy = multipleActions(notifySns(onAlarmTopic), triggerLambda(onAlarmFunction));
183+
```
184+
172185
### Custom metrics
173186

174187
For simply adding some custom metrics, you can use `.monitorCustom()` and specify your own title and metric groups.

0 commit comments

Comments
 (0)