title: AWS Alarm not getting value from metric
body: <p>I havea  requirement to setup a CloudWatch alarm with <code>CPUUtilization </code>metric type for cluster and service dimensions. To setup these resources I am using CDK library and after deploy CDKstack things looks fine. Both alarm and metric are available in ECS cluster.</p>
  <p>Following is piece of code that I am using for same.
  Now when I increase CPU load using stress utility then this CDK code doesn't work but if I create alarm manually using AWS GUI then things work fine.</p>
  <p>Can someone help me on this ?</p>
  <pre><code>export class HelloCdkStack extends Stack {
    constructor(scope: Construct, id: string, props?: StackProps) {
      super(scope, id, props);
  
      const vpc = new ec2.Vpc(this, &quot;AlarmVpc3&quot;, {
         maxAzs: 3
       });
  
      const cluster = new ecs.Cluster(this, &quot;AlarmClusterDemo3&quot;, {
         vpc: vpc,
         containerInsights: true,
         clusterName: &quot;DemoCluster&quot;
      });
  
      cluster.addCapacity('DefaultAutoScalingGroupCapacity', {
        instanceType: new ec2.InstanceType(&quot;t2.micro&quot;),
      });
  
      const taskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDefDemo3', {
        // memoryLimitMiB: 512,
        // cpu: 256 
      });
  
      taskDefinition.addContainer('MyContainer', {
        image: ecs.ContainerImage.fromRegistry(&quot;amazon/amazon-ecs-sample&quot;),
        memoryLimitMiB: 512,
      });
  
      // Instantiate an Amazon ECS Service
      const ecsService = new ecs.FargateService(this, 'ServiceDemo3', {
        serviceName: &quot;DemoService&quot;,
        cluster,
        taskDefinition,
        enableExecuteCommand: true,
        desiredCount: 1
      });
  
      const cpuMetric = new cloudwatch.Metric({
        namespace: 'AWS/ECS ',
        metricName: 'CPUUtilization', //ECS/ContainerInsights
        period: Duration.minutes(1),
        dimensionsMap: {
          ServiceName: &quot;AlarmCdk3-ServiceDemo3Service80A0F131-LofBYzFzUatv&quot;,
          ClusterName: &quot;AlarmCdk3-AlarmClusterDemo3EF161BDA-jm7guu27s8bV&quot;
        }
      });
      
      const cpuAlarm = new cloudwatch.Alarm(taskDefinition, 'CPUAlarmDemo', {
        alarmName: &quot;DemoAlarm&quot;,
        metric: cpuMetric,
        threshold: 5,
        evaluationPeriods: 1,
        datapointsToAlarm: 1,
      });
      
    } 
  }
  </code></pre>