开发者

AWS - CDK: Get resources from CfnEnvironment

开发者 https://www.devze.com 2022-12-07 18:41 出处:网络
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 det

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

精彩评论

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