当由cloudformation模板形成时,AWS cloudwatch警报无法访问EMR群集指标中的数据

问题描述 投票:0回答:1
{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Metadata": {
        "AWS::CloudFormation::Designer": {
            "0146279a-ddf6-40fa-bf45-612cebe20c3f": {
                "size": {
                    "width": 60,
                    "height": 60
                },
                "position": {
                    "x": 290,
                    "y": 80
                },
                "z": 0,
                "embeds": []
            },
            "f53318cc-f7a9-4e0b-9d22-7de325b7409d": {
                "size": {
                    "width": 60,
                    "height": 60
                },
                "position": {
                    "x": 430,
                    "y": 80
                },
                "z": 0
            }
        }
    },
    "Resources": {
        "EMRC1YFGX": {
            "Type": "AWS::EMR::Cluster",
            "Properties": {
                "ReleaseLabel": "emr-5.30.0",
                "Instances": {
                    "MasterInstanceGroup": {
                        "InstanceCount": 1,
                        "InstanceType": "m5.xlarge"
                    },
                    "CoreInstanceGroup": {
                        "InstanceCount": 1,
                        "InstanceType": "m5.xlarge"
                    }
                },
                "Name": "Tupac",
                "JobFlowRole": "arn:aws:iam::261537044157:instance-profile/EMR_EC2_DefaultRole",
                "ServiceRole": "arn:aws:iam::261537044157:role/shubhamam"
            },
            "Metadata": {
                "AWS::CloudFormation::Designer": {
                    "id": "0146279a-ddf6-40fa-bf45-612cebe20c3f"
                }
            }
        },
        "CWA2VB7L": {
            "Type": "AWS::CloudWatch::Alarm",
            "Properties": {
                "AlarmName": "alarm101",
                "AlarmActions": ["arn:aws:sns:us-east-1:2615370449570:emr_idle_notification"],
                "ComparisonOperator": "GreaterThanOrEqualToThreshold",
                "Dimensions": [
                    {
                        "Name": "JobflowId",
                        "Value": {"Ref": "EMRC1YFGX"}
                    }
                ],
                "EvaluationPeriods": 1,
                "MetricName": "IsIdle",
                "Namespace": "AWS/ElasticMapReduce",
                "Period": 300,
                "Statistic": "Minimum",
                "Threshold": 1,
            },
            "Metadata": {
                "AWS::CloudFormation::Designer": {
                    "id": "f53318cc-f7a9-4e0b-9d22-7de325b7409d"
                }
            }
        }
    }
}

我正在使用上述cloudformation模板来创建我的EMR集群和Cloudwatch警报。如果我从控制台创建了正常警报,则它无法正常工作,但是在cloudformation期间创建时,它不起作用。警报已创建,但无法从EMR指标获取任何数据。它说没有数据,并且仍处于数据不足状态。

amazon-web-services amazon-cloudformation amazon-emr amazon-cloudwatch
1个回答
0
投票

明显的问题是使用JobflowId而不是JobFlowId

这是因为维度名称是区分大小写

我在CloudWatch中找不到有关维度名称区分大小写的文档,因此我自己通过创建两个警报测试了

一个警报基于正确拼写的尺寸名称AmazonEC2(计费指标)。第二次警报基于拼写错误的拼写名称:AmazonEc2。两个警报之间的其他所有内容都相同。

我发现名称不正确的警报在INSUFFICIENT sate中已堆叠。这与OP报告的状态相同。

警报的屏幕截图(费用已消失):

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.