【发布时间】:2018-11-27 06:58:45
【问题描述】:
我想设置警报,以防 CloudWatch 在 CloudFront 上发生错误。
在控制台中,我会直接创建一个警报,如果 TotalErrorRate 大于 0,我会向我发送电子邮件。这工作正常。
但现在我想在 CloudFormation 的 yaml 模板文件中设置相同的设置。我无法确定相应参数的正确值。我的文件目前如下所示:
# CloudWatch
CloudFrontTotalErrorRateAlarm:
Type: "AWS::CloudWatch::Alarm"
Properties:
ActionsEnabled: Boolean
AlarmActions:
- String
AlarmDescription: "Trigers an alarm if there is any error (e.g. 4xx,5xx)"
AlarmName: "MyApiTotalErrorRate"
ComparisonOperator: GreaterThanThreshold
Dimensions:
- Dimension
EvaluationPeriods: "1"
ExtendedStatistic: String
InsufficientDataActions:
- String
MetricName: TotalErrorRate
Namespace: AWS/CloudFront
OKActions:
- String
Period: 60
Statistic: String
Threshold: 0
TreatMissingData: String
Unit: String
对于某些参数,我可以计算出实际值可能是多少。但对于其他人,我基本上不知道我应该输入什么,以便 AWS 会在发生错误时向我发送电子邮件。以下参数为缺失值:
ActionsEnabledAlarmActionsDimensionsExtendedStatisticInsufficientDataActionsOKActionsStatisticTreatMissingDataUnit
【问题讨论】:
标签: amazon-web-services amazon-cloudformation amazon-cloudwatch amazon-cloudwatch-metrics