gpt4 book ai didi

amazon-web-services - AWS CloudFormation 失败并出现错误 "Encountered unsupported property name"

转载 作者:行者123 更新时间:2023-12-02 16:50:23 25 4
gpt4 key购买 nike

我正在尝试使用以下 CloudFormation 模板基于异常检测模型创建警报并收到错误:

有人可以帮我解决这个问题吗?

"Resources": {
"CPUUtilizationAlarm": {
"Type": "AWS::CloudWatch::Alarm",
"Properties": {
"AlarmDescription": "Alarm Triggered",
"AlarmName": "CPUUtilizationAlarm",
"ComparisonOperator": "GreaterThanUpperThreshold",
"EvaluationPeriods": 1,
"Dimensions": [],
"Metrics": [
{
"Expression": "ANOMALY_DETECTION_BAND(m1, 10)",
"Id": "ad1"
},
{
"Id": "m1",
"MetricStat": {
"Metric": {
"MetricName": "CPUUtilization",
"Namespace": "AWS/EC2",
"Dimensions": [
{
"value": "i-05157fe1be36d52bd",
"name": "InstanceId"
}
],
},
"Period": 60,
"Stat": "Average"
}
}
],
"ThresholdMetricId": "ad1",
"TreatMissingData": "breaching",
}
}
}

最佳答案

根据错误,警报定义中有一个名为 name 的属性无效。仔细观察一下,Dimensions 数组有键 namevalue,而它应该是 NameValue,而不是像下面那样此处定义的示例

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-dimension.html .

关于amazon-web-services - AWS CloudFormation 失败并出现错误 "Encountered unsupported property name",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58984332/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com