【发布时间】:2021-10-23 06:15:57
【问题描述】:
我已经像这样创建了一个 ECS 集群:
this.cluster = new ecs.Cluster(this, 'Cluster', {
containerInsights: true,
vpc: ec2.Vpc.fromLookup(this, props.stage + 'Vpc', {isDefault: false})
});
我想根据我的集群创建一个 CW 警报,如下所示:
const CPUHigh = new cw.Alarm(this, "CPUHigh", {
metric: this.cluster.metric("CPUUtilized"),
threshold: 50,
evaluationPeriods: 3,
period: cdk.Duration.seconds(60),
comparisonOperator: cw.ComparisonOperator.GREATER_THAN_THRESHOLD
})
但即使该指标与 Container Insights 创建的指标相匹配,但似乎无法以这种方式引用它。
有谁知道它应该被引用的方式吗?
【问题讨论】:
标签: javascript typescript amazon-ecs aws-cdk aws-fargate