开发者

AWS - CDK: Get resources from CfnEnvironment

I am creating a beanstalk using the CDK and after than I would like to create the cloudwatch dashboard on the same the stalk to view the beanstalk metrics. How can I get the beanstalk loadbalancer details using CfnEnvironment?

const dashboardBody = {
    widgets:[
        {
            "type": "metric",
            "width": 24,
            "height": 3,
            "properties": {
                "title": "Request Count",
                "metrics": [
                    [
                        "AWS/ApplicationELB",
                        "RequestCount",
                        "LoadBalancer",
                        ***"<<Loadbalancer Name>>"***
                    ]
                ],
                "region": "<<AWS Region>>",
                "stat": &quo开发者_如何学运维t;Sum",
                "yAxis": {
                    "left": {
                        "min": 0
                    }
                }
            }
        }
    ]
}
const dashobard = new cdk.aws_cloudwatch.CfnDashboard(this, 'dashboard', {
    dashboardName: 'dashboard',
    dashboardBody: JSON.stringify(dashboardBody)
})

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜