我正在尝试将小部件添加到yaml中的云形成模板中的仪表板。我正在努力做到这一点,以便为部署的每个堆栈自动为该主仪表板创建一个小部件以帮助监视。但是,每当我部署时,它都会指示仪表板“已经存在”,然后失败。我想简单地添加到此现有的仪表板中。
AutoScalingDashboardMetrics:
Type: AWS::CloudWatch::Dashboard
Properties:
DashboardBody: !Sub |
{
"start": "-PT9H",
"periodOverride": "inherit",
"widgets": [
{
"type":"metric",
"properties":{
"metrics": [
[ "AWS/AutoScaling", "GroupTotalInstances", "AutoScalingGroupName", "${AWS::StackName}", { "period": 300 } ],
[ ".", "GroupStandbyInstances", ".", ".", { "period": 300 } ],
[ ".", "GroupDesiredCapacity", ".", ".", { "period": 300 } ]
],
"view": "timeSeries",
"stacked": false,
"region": "{AWS::Region}",
"title": "ASG Instances: ${AWS::StackName}",
"period": 300
}
}
]
}
DashboardName: test
答案 0 :(得分:0)
要使用CloudFormation向现有的仪表板添加内容,必须使用CloudFormation管理该仪表板。
您可以做什么:
Action
-> View/Edit source
并
将源代码复制到您的CloudFormation代码中。