有没有人能提供一些关于如何使用Cdk创建简单的cloudwatch警报、警报、指标的基本设置?
我对使用typescript的CDK -and非常陌生。我只需要一些启动指南,在哪里创建这些ts文件-我有点困惑
发布于 2020-08-04 13:57:11
可以使用Alarm CDK construct.
创建
new Alarm(this, "Errors", {
alarmName: "MyTestAlarm",
metric: new Metric({
"metricName": "MyTestMetric",
"namespace": "SampleApplicationName",
"period": Duration.minutes(1),
"unit": Unit.COUNT,
"statistic": Statistic.SUM
}),
threshold: 0,
comparisonOperator: ComparisonOperator.GREATER_THAN_THRESHOLD,
treatMissingData: TreatMissingData.NOT_BREACHING,
evaluationPeriods: 3
});请参考Cloudwatch CDK Typescript overview了解更多的深度和理解。
另外,使用CDK Typescript样例应用程序here's一个GitHub存储库。这些示例将帮助您进行基本的CDK应用程序设置。
编辑
Cloudwatch documentation是一个理解基本概念的好地方。
发布于 2020-12-10 20:46:39
new cloudwatch.Alarm(this, "Errors", {
alarmName: "AlertForEDITest",
metric: new cloudwatch.Metric({
"metricName": "NDMEDIMetricTest",
"namespace": "NDMItemsTest",
"period": Duration.minutes(1),
"unit": cloudwatch.Unit.COUNT,
"statistic": cloudwatch.Statistic.SUM
}),
threshold: 1,
comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_THRESHOLD,
treatMissingData: cloudwatch.TreatMissingData.NOT_BREACHING,
evaluationPeriods: 30
});https://stackoverflow.com/questions/63240240
复制相似问题