【问题标题】:How Do I add a widget to an existing dashboard in AWS?如何将小部件添加到 AWS 中的现有控制面板?
【发布时间】:2020-02-13 10:00:53
【问题描述】:

我正在尝试将小部件添加到 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

【问题讨论】:

    标签: amazon-web-services yaml amazon-cloudformation amazon-cloudwatch amazon-cloudwatch-metrics


    【解决方案1】:

    要使用 CloudFormation 向现有仪表板添加内容,必须使用 CloudFormation 管理该仪表板。

    你可以做什么:

    1. 转到现有仪表板,执行Action -> View/Edit source 和 将源代码复制到您的 CloudFormation 代码中。
    2. 重命名现有仪表板。
    3. 使用 CloudFormation 构建仪表板。
    4. 将您需要的内容添加到 CloudFormation 模板和更新堆栈。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多