This template configures a CloudWatch Metric Stream to include additional statistics for the CPUUtilization metric from the AWS/EC2 namespace.

Terraform Template

resource "aws_cloudwatch_metric_stream" "main" {
  firehose_arn = "aws_kinesis_firehose_delivery_stream.s3_stream.arn"
  name = "my-metric-stream"
  output_format = "json"
  role_arn = "aws_iam_role.metric_stream_to_firehose.arn"
  statistics_configuration = ["p1", "tm99", "CPUUtilization", "AWS/EC2", "TS(50.5:)", "CPUUtilization", "AWS/EC2"]
}