【发布时间】:2019-10-30 03:36:09
【问题描述】:
我无法在小部件中引用服务名称。
使用给定代码出现以下错误: 仪表板正文无效,有 1 个验证错误: [ { "dataPath": "/widgets/0/properties/metrics/0", "message": "Should NOT have more than 3 items" } ] (服务:AmazonCloudWatch ; 状态码: 400; 错误码: InvalidParameterInput
"CloudwatchDashboard": {
"Type": "AWS::CloudWatch::Dashboard",
"Properties": {
"{ \"widgets\":
[{ \"type\":\"metric\",
\"x\":0,
\"y\":0,
\"width\":12,
\"height\":6,
\"properties\":
{ \"metrics\":
[[ \"AWS/ECS\", \"CPUUtilization\", \"ServiceName\",
{ \"Fn::Sub\": [ \"${Service}\", { \"Service\": {\"Ref\" : \"AWS::StackName\" }} ]}]],
\"region\": \"us-east-1\",
\"stat\":\"Average\",
\"period\": 300,
\"view\": \"timeSeries\",
\"title\":\"CPUUtilization\",
\"stacked\": false } }]}"
}
}
【问题讨论】:
标签: json amazon-web-services amazon-cloudformation amazon-cloudwatch amazon-cloudwatch-metrics