如何使用 CF 正确配置 Route53 HealthCheck 警报(在悉尼) [英] How to correctly configure Route53 HealthCheck Alarm with CF (in Sydney)
问题描述
我已将 Route53 HealthCheck 配置为与 CloudFormation 关联的警报,但结果运行状况检查显示未配置警报,并且 CloudWatch 控制台中的警报仍然无效.如果我在 HealthChecks 中手动创建警报,则一切正常.
I've configured a Route53 HealthCheck with an associated alarm with CloudFormation, but the resulting healthcheck shows as having No alarms configured, and the alarms in the CloudWatch console remain dead. If I manually create the alarm in HealthChecks, everything works.
更糟糕的是,如果我从悉尼/ap-southeast-2
切换并在北弗吉尼亚/us-east-1
创建相同的云形成堆栈,警报是与健康检查正确关联,一切正常!
Worse, if I switch from Sydney/ap-southeast-2
and create the same cloud formation stack in North Virginia/us-east-1
, the alarm is correctly associated with the health check and everything works!
另外一个数据点:在 Route53 HealthChecks 中手动创建警报时,警报是在 us-east-1
中创建的,尽管 Route53 是全局的且 ap-southeast-1
> 是所有其他控制台的默认设置.
One more datapoint: when manually creating the alarm in Route53 HealthChecks, the alarm is created in us-east-1
, despite Route53 being global and ap-southeast-1
being the default in all other consoles.
我的简化堆栈如下所示:
My simplified stack looks like this:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "healthcheck alarm test",
"Resources": {
"StatusHealthCheck": {
"Type": "AWS::Route53::HealthCheck",
"Properties": {
"HealthCheckConfig": {
"Port": "80",
"Type": "HTTP",
"ResourcePath": "/status",
"FullyQualifiedDomainName": "testdomain.com",
"RequestInterval": "30",
"FailureThreshold": "1"
},
"HealthCheckTags": [
{
"Key": "Name",
"Value": "status reachability check"
}
]
}
},
"StatusHealthCheckFailedAlarm": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"ActionsEnabled": "true",
"AlarmDescription": "alarmed when status doesn't respond",
"ComparisonOperator": "LessThanThreshold",
"EvaluationPeriods": "1",
"MetricName": "HealthCheckStatus",
"Namespace": "AWS/Route53",
"Period": "60",
"Statistic": "Minimum",
"Threshold": "1.0",
"Dimensions": [
{
"Name": "HealthCheckId",
"Value": {
"Ref": "StatusHealthCheck"
}
}
]
}
}
}
}
有什么理由让它在北弗吉尼亚有效而不在悉尼有效吗?
Is there any reason it should work in North Virginia but not in Sydney?
推荐答案
HealthCheck 生成的 CloudWatch 指标仅在美国东部地区可见,如本页底部所述 http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-monitor-view-status.html.这就是为什么您的堆栈在 us-east-1 中创建时可以正常工作的原因.
The CloudWatch metrics generated by the HealthCheck are only visible in the US-East region, as described at the bottom of this page http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-monitor-view-status.html. This is why your stack works correctly when created in us-east-1.
这篇关于如何使用 CF 正确配置 Route53 HealthCheck 警报(在悉尼)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!