diff --git a/API.md b/API.md index 26b8af33..c1c25d45 100644 --- a/API.md +++ b/API.md @@ -8970,17 +8970,17 @@ const baseServiceMetricFactoryProps: BaseServiceMetricFactoryProps = { ... } | **Name** | **Type** | **Description** | | --- | --- | --- | -| service | aws-cdk-lib.aws_ecs.BaseService | *No description.* | +| service | aws-cdk-lib.aws_ecs.IBaseService | *No description.* | --- ##### `service`Required ```typescript -public readonly service: BaseService; +public readonly service: IBaseService; ``` -- *Type:* aws-cdk-lib.aws_ecs.BaseService +- *Type:* aws-cdk-lib.aws_ecs.IBaseService --- @@ -11599,7 +11599,7 @@ const customEc2ServiceMonitoringProps: CustomEc2ServiceMonitoringProps = { ... } | addRunningTaskCountAlarm | {[ key: string ]: RunningTaskCountThreshold} | Container Insights needs to be enabled for the cluster for this alarm. | | maxAutoScalingTaskCount | number | maximum number of tasks, as specified in your auto scaling config. | | minAutoScalingTaskCount | number | minimum number of tasks, as specified in your auto scaling config. | -| ec2Service | aws-cdk-lib.aws_ecs.Ec2Service | *No description.* | +| ec2Service | aws-cdk-lib.aws_ecs.IBaseService | *No description.* | | addHealthyTaskCountAlarm | {[ key: string ]: HealthyTaskCountThreshold} | *No description.* | | addHealthyTaskPercentAlarm | {[ key: string ]: HealthyTaskPercentThreshold} | *No description.* | | addMinProcessedBytesAlarm | {[ key: string ]: MinProcessedBytesThreshold} | *No description.* | @@ -11767,10 +11767,10 @@ minimum number of tasks, as specified in your auto scaling config. ##### `ec2Service`Required ```typescript -public readonly ec2Service: Ec2Service; +public readonly ec2Service: IBaseService; ``` -- *Type:* aws-cdk-lib.aws_ecs.Ec2Service +- *Type:* aws-cdk-lib.aws_ecs.IBaseService --- @@ -11879,7 +11879,7 @@ const customFargateServiceMonitoringProps: CustomFargateServiceMonitoringProps = | addRunningTaskCountAlarm | {[ key: string ]: RunningTaskCountThreshold} | Container Insights needs to be enabled for the cluster for this alarm. | | maxAutoScalingTaskCount | number | maximum number of tasks, as specified in your auto scaling config. | | minAutoScalingTaskCount | number | minimum number of tasks, as specified in your auto scaling config. | -| fargateService | aws-cdk-lib.aws_ecs.FargateService | *No description.* | +| fargateService | aws-cdk-lib.aws_ecs.IBaseService | *No description.* | | addHealthyTaskCountAlarm | {[ key: string ]: HealthyTaskCountThreshold} | *No description.* | | addHealthyTaskPercentAlarm | {[ key: string ]: HealthyTaskPercentThreshold} | *No description.* | | addMinProcessedBytesAlarm | {[ key: string ]: MinProcessedBytesThreshold} | *No description.* | @@ -12047,10 +12047,10 @@ minimum number of tasks, as specified in your auto scaling config. ##### `fargateService`Required ```typescript -public readonly fargateService: FargateService; +public readonly fargateService: IBaseService; ``` -- *Type:* aws-cdk-lib.aws_ecs.FargateService +- *Type:* aws-cdk-lib.aws_ecs.IBaseService --- diff --git a/lib/monitoring/aws-ecs-patterns/BaseServiceMetricFactory.ts b/lib/monitoring/aws-ecs-patterns/BaseServiceMetricFactory.ts index a6ca2a55..1af077b0 100644 --- a/lib/monitoring/aws-ecs-patterns/BaseServiceMetricFactory.ts +++ b/lib/monitoring/aws-ecs-patterns/BaseServiceMetricFactory.ts @@ -1,14 +1,16 @@ -import { BaseService } from "aws-cdk-lib/aws-ecs"; +import { DimensionsMap } from "aws-cdk-lib/aws-cloudwatch"; +import { IBaseService } from "aws-cdk-lib/aws-ecs"; import { MetricFactory, MetricStatistic } from "../../common"; +const EcsNamespace = "AWS/ECS"; const EcsContainerInsightsNamespace = "ECS/ContainerInsights"; /** * Props to create BaseServiceMetricFactory. */ export interface BaseServiceMetricFactoryProps { - readonly service: BaseService; + readonly service: IBaseService; } /** @@ -16,29 +18,43 @@ export interface BaseServiceMetricFactoryProps { */ export class BaseServiceMetricFactory { protected readonly metricFactory: MetricFactory; - protected readonly service: BaseService; + protected readonly dimensionsMap: DimensionsMap; + /** + * @deprecated This isn't required by cdk-monitoring-constructs anymore; use your own reference. + */ + protected readonly service: IBaseService; constructor( metricFactory: MetricFactory, props: BaseServiceMetricFactoryProps ) { this.metricFactory = metricFactory; + this.dimensionsMap = { + ClusterName: props.service.cluster.clusterName, + ServiceName: props.service.serviceName, + }; this.service = props.service; } metricClusterCpuUtilisationInPercent() { - return this.metricFactory.adaptMetric( - this.service.metricCpuUtilization({ - label: "Cluster CPU Utilization", - }) + return this.metricFactory.createMetric( + "CPUUtilization", + MetricStatistic.AVERAGE, + "Cluster CPU Utilization", + this.dimensionsMap, + undefined, + EcsNamespace ); } metricClusterMemoryUtilisationInPercent() { - return this.metricFactory.adaptMetric( - this.service.metricMemoryUtilization({ - label: "Cluster Memory Utilization", - }) + return this.metricFactory.createMetric( + "MemoryUtilization", + MetricStatistic.AVERAGE, + "Cluster Memory Utilization", + this.dimensionsMap, + undefined, + EcsNamespace ); } @@ -47,10 +63,7 @@ export class BaseServiceMetricFactory { "RunningTaskCount", MetricStatistic.AVERAGE, "Running Tasks", - { - ServiceName: this.service.serviceName, - ClusterName: this.service.cluster.clusterName, - }, + this.dimensionsMap, undefined, EcsContainerInsightsNamespace ); diff --git a/lib/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.ts b/lib/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.ts index d9e760cd..4f0005d4 100644 --- a/lib/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.ts +++ b/lib/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.ts @@ -4,7 +4,7 @@ import { IMetric, IWidget, } from "aws-cdk-lib/aws-cloudwatch"; -import { Ec2Service } from "aws-cdk-lib/aws-ecs"; +import { Ec2Service, IBaseService } from "aws-cdk-lib/aws-ecs"; import { ApplicationLoadBalancedEc2Service, NetworkLoadBalancedEc2Service, @@ -147,7 +147,7 @@ export interface Ec2ApplicationLoadBalancerMonitoringProps export interface CustomEc2ServiceMonitoringProps extends BaseLoadBalancedEc2ServiceMonitoringProps { - readonly ec2Service: Ec2Service; + readonly ec2Service: IBaseService; readonly loadBalancer?: IApplicationLoadBalancer | INetworkLoadBalancer; readonly targetGroup?: IApplicationTargetGroup | INetworkTargetGroup; } diff --git a/lib/monitoring/aws-ecs-patterns/FargateServiceMonitoring.ts b/lib/monitoring/aws-ecs-patterns/FargateServiceMonitoring.ts index e94ae8e2..da13ea4d 100644 --- a/lib/monitoring/aws-ecs-patterns/FargateServiceMonitoring.ts +++ b/lib/monitoring/aws-ecs-patterns/FargateServiceMonitoring.ts @@ -4,7 +4,7 @@ import { IMetric, IWidget, } from "aws-cdk-lib/aws-cloudwatch"; -import { FargateService } from "aws-cdk-lib/aws-ecs"; +import { FargateService, IBaseService } from "aws-cdk-lib/aws-ecs"; import { ApplicationLoadBalancedFargateService, NetworkLoadBalancedFargateService, @@ -147,7 +147,7 @@ export interface FargateApplicationLoadBalancerMonitoringProps export interface CustomFargateServiceMonitoringProps extends BaseLoadBalancedFargateServiceMonitoringProps { - readonly fargateService: FargateService; + readonly fargateService: IBaseService; readonly loadBalancer?: IApplicationLoadBalancer | INetworkLoadBalancer; readonly targetGroup?: IApplicationTargetGroup | INetworkTargetGroup; } diff --git a/test/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.test.ts b/test/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.test.ts index 3ccd0f6a..ebde598e 100644 --- a/test/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.test.ts +++ b/test/monitoring/aws-ecs-patterns/Ec2ServiceMonitoring.test.ts @@ -2,7 +2,7 @@ import { Stack } from "aws-cdk-lib"; import { Template } from "aws-cdk-lib/assertions"; import { InstanceType } from "aws-cdk-lib/aws-ec2"; import { Repository } from "aws-cdk-lib/aws-ecr"; -import { Cluster, EcrImage } from "aws-cdk-lib/aws-ecs"; +import { Cluster, Ec2Service, EcrImage } from "aws-cdk-lib/aws-ecs"; import { ApplicationLoadBalancedEc2Service, NetworkLoadBalancedEc2Service, @@ -261,3 +261,29 @@ import { TestMonitoringScope } from "../TestMonitoringScope"; }); } ); + +test("snapshot test: with imported service", () => { + const stack = new Stack(); + + const importedService = Ec2Service.fromEc2ServiceAttributes( + stack, + "ImportedEc2Service", + { + cluster: Cluster.fromClusterArn( + stack, + "ImportedCluster", + "arn:aws:ecs:us-west-2:123456789012:cluster/DummyCluster" + ), + serviceName: "DummyService", + } + ); + + const scope = new TestMonitoringScope(stack, "Scope"); + const monitoring = new Ec2ServiceMonitoring(scope, { + ec2Service: importedService, + alarmFriendlyName: "DummyEc2Service", + }); + + addMonitoringDashboardsToStack(stack, monitoring); + expect(Template.fromStack(stack)).toMatchSnapshot(); +}); diff --git a/test/monitoring/aws-ecs-patterns/FargateServiceMonitoring.test.ts b/test/monitoring/aws-ecs-patterns/FargateServiceMonitoring.test.ts index 9cc455e5..a9fe2ef6 100644 --- a/test/monitoring/aws-ecs-patterns/FargateServiceMonitoring.test.ts +++ b/test/monitoring/aws-ecs-patterns/FargateServiceMonitoring.test.ts @@ -457,3 +457,29 @@ import { TestMonitoringScope } from "../TestMonitoringScope"; }); } ); + +test("snapshot test: with imported service", () => { + const stack = new Stack(); + + const importedService = FargateService.fromFargateServiceAttributes( + stack, + "ImportedEc2Service", + { + cluster: Cluster.fromClusterArn( + stack, + "ImportedCluster", + "arn:aws:ecs:us-west-2:123456789012:cluster/DummyCluster" + ), + serviceName: "DummyService", + } + ); + + const scope = new TestMonitoringScope(stack, "Scope"); + const monitoring = new FargateServiceMonitoring(scope, { + fargateService: importedService, + alarmFriendlyName: "DummyFargateService", + }); + + addMonitoringDashboardsToStack(stack, monitoring); + expect(Template.fromStack(stack)).toMatchSnapshot(); +}); diff --git a/test/monitoring/aws-ecs-patterns/__snapshots__/Ec2ServiceMonitoring.test.ts.snap b/test/monitoring/aws-ecs-patterns/__snapshots__/Ec2ServiceMonitoring.test.ts.snap index 6f5fbd6a..3d78ccbe 100644 --- a/test/monitoring/aws-ecs-patterns/__snapshots__/Ec2ServiceMonitoring.test.ts.snap +++ b/test/monitoring/aws-ecs-patterns/__snapshots__/Ec2ServiceMonitoring.test.ts.snap @@ -23783,3 +23783,100 @@ echo ECS_AWSVPC_BLOCK_IMDS=true >> /etc/ecs/ecs.config", }, } `; + +exports[`snapshot test: with imported service 1`] = ` +Object { + "Parameters": Object { + "BootstrapVersion": Object { + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]", + "Type": "AWS::SSM::Parameter::Value", + }, + }, + "Resources": Object { + "Alarm7103F465": Object { + "Properties": Object { + "DashboardBody": "{\\"widgets\\":[]}", + }, + "Type": "AWS::CloudWatch::Dashboard", + }, + "Resource": Object { + "Properties": Object { + "DashboardBody": Object { + "Fn::Join": Array [ + "", + Array [ + "{\\"widgets\\":[{\\"type\\":\\"text\\",\\"width\\":24,\\"height\\":1,\\"x\\":0,\\"y\\":0,\\"properties\\":{\\"markdown\\":\\"### Ec2 Service **ImportedEc2Service**\\"}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":5,\\"x\\":0,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"CPU Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"CPUUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster CPU Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":5,\\"x\\":8,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Memory Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"MemoryUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster Memory Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":5,\\"x\\":16,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Task Count\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"ECS/ContainerInsights\\",\\"RunningTaskCount\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Running Tasks\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", + ], + ], + }, + }, + "Type": "AWS::CloudWatch::Dashboard", + }, + "Summary68521F81": Object { + "Properties": Object { + "DashboardBody": Object { + "Fn::Join": Array [ + "", + Array [ + "{\\"widgets\\":[{\\"type\\":\\"text\\",\\"width\\":24,\\"height\\":1,\\"x\\":0,\\"y\\":0,\\"properties\\":{\\"markdown\\":\\"### Ec2 Service **ImportedEc2Service**\\"}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":6,\\"x\\":0,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"CPU Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"CPUUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster CPU Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":6,\\"x\\":8,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Memory Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"MemoryUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster Memory Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":6,\\"x\\":16,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Task Count\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"ECS/ContainerInsights\\",\\"RunningTaskCount\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Running Tasks\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", + ], + ], + }, + }, + "Type": "AWS::CloudWatch::Dashboard", + }, + }, + "Rules": Object { + "CheckBootstrapVersion": Object { + "Assertions": Array [ + Object { + "Assert": Object { + "Fn::Not": Array [ + Object { + "Fn::Contains": Array [ + Array [ + "1", + "2", + "3", + "4", + "5", + ], + Object { + "Ref": "BootstrapVersion", + }, + ], + }, + ], + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.", + }, + ], + }, + }, +} +`; diff --git a/test/monitoring/aws-ecs-patterns/__snapshots__/FargateServiceMonitoring.test.ts.snap b/test/monitoring/aws-ecs-patterns/__snapshots__/FargateServiceMonitoring.test.ts.snap index 4d608be6..c2e6bbc2 100644 --- a/test/monitoring/aws-ecs-patterns/__snapshots__/FargateServiceMonitoring.test.ts.snap +++ b/test/monitoring/aws-ecs-patterns/__snapshots__/FargateServiceMonitoring.test.ts.snap @@ -30686,3 +30686,100 @@ Object { }, } `; + +exports[`snapshot test: with imported service 1`] = ` +Object { + "Parameters": Object { + "BootstrapVersion": Object { + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]", + "Type": "AWS::SSM::Parameter::Value", + }, + }, + "Resources": Object { + "Alarm7103F465": Object { + "Properties": Object { + "DashboardBody": "{\\"widgets\\":[]}", + }, + "Type": "AWS::CloudWatch::Dashboard", + }, + "Resource": Object { + "Properties": Object { + "DashboardBody": Object { + "Fn::Join": Array [ + "", + Array [ + "{\\"widgets\\":[{\\"type\\":\\"text\\",\\"width\\":24,\\"height\\":1,\\"x\\":0,\\"y\\":0,\\"properties\\":{\\"markdown\\":\\"### Fargate Service **ImportedEc2Service**\\"}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":5,\\"x\\":0,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"CPU Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"CPUUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster CPU Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":5,\\"x\\":8,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Memory Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"MemoryUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster Memory Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":5,\\"x\\":16,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Task Count\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"ECS/ContainerInsights\\",\\"RunningTaskCount\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Running Tasks\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", + ], + ], + }, + }, + "Type": "AWS::CloudWatch::Dashboard", + }, + "Summary68521F81": Object { + "Properties": Object { + "DashboardBody": Object { + "Fn::Join": Array [ + "", + Array [ + "{\\"widgets\\":[{\\"type\\":\\"text\\",\\"width\\":24,\\"height\\":1,\\"x\\":0,\\"y\\":0,\\"properties\\":{\\"markdown\\":\\"### Fargate Service **ImportedEc2Service**\\"}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":6,\\"x\\":0,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"CPU Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"CPUUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster CPU Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":6,\\"x\\":8,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Memory Utilization\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"AWS/ECS\\",\\"MemoryUtilization\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Cluster Memory Utilization\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"max\\":100,\\"label\\":\\"%\\",\\"showUnits\\":false}}}},{\\"type\\":\\"metric\\",\\"width\\":8,\\"height\\":6,\\"x\\":16,\\"y\\":1,\\"properties\\":{\\"view\\":\\"timeSeries\\",\\"title\\":\\"Task Count\\",\\"region\\":\\"", + Object { + "Ref": "AWS::Region", + }, + "\\",\\"metrics\\":[[\\"ECS/ContainerInsights\\",\\"RunningTaskCount\\",\\"ClusterName\\",\\"DummyCluster\\",\\"ServiceName\\",\\"DummyService\\",{\\"label\\":\\"Running Tasks\\"}]],\\"yAxis\\":{\\"left\\":{\\"min\\":0,\\"label\\":\\"Count\\",\\"showUnits\\":false}}}}]}", + ], + ], + }, + }, + "Type": "AWS::CloudWatch::Dashboard", + }, + }, + "Rules": Object { + "CheckBootstrapVersion": Object { + "Assertions": Array [ + Object { + "Assert": Object { + "Fn::Not": Array [ + Object { + "Fn::Contains": Array [ + Array [ + "1", + "2", + "3", + "4", + "5", + ], + Object { + "Ref": "BootstrapVersion", + }, + ], + }, + ], + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.", + }, + ], + }, + }, +} +`;