AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

MetricStream

Provides a CloudWatch Metric Stream resource.

Example Usage

Filters

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        // https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
        var metricStreamToFirehoseRole = new Aws.Iam.Role("metricStreamToFirehoseRole", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": [
    {
      ""Action"": ""sts:AssumeRole"",
      ""Principal"": {
        ""Service"": ""streams.metrics.cloudwatch.amazonaws.com""
      },
      ""Effect"": ""Allow"",
      ""Sid"": """"
    }
  ]
}
",
        });
        var bucket = new Aws.S3.BucketV2("bucket", new Aws.S3.BucketV2Args
        {
        });
        var firehoseToS3Role = new Aws.Iam.Role("firehoseToS3Role", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": [
    {
      ""Action"": ""sts:AssumeRole"",
      ""Principal"": {
        ""Service"": ""firehose.amazonaws.com""
      },
      ""Effect"": ""Allow"",
      ""Sid"": """"
    }
  ]
}
",
        });
        var s3Stream = new Aws.Kinesis.FirehoseDeliveryStream("s3Stream", new Aws.Kinesis.FirehoseDeliveryStreamArgs
        {
            Destination = "s3",
            S3Configuration = new Aws.Kinesis.Inputs.FirehoseDeliveryStreamS3ConfigurationArgs
            {
                RoleArn = firehoseToS3Role.Arn,
                BucketArn = bucket.Arn,
            },
        });
        var main = new Aws.CloudWatch.MetricStream("main", new Aws.CloudWatch.MetricStreamArgs
        {
            RoleArn = metricStreamToFirehoseRole.Arn,
            FirehoseArn = s3Stream.Arn,
            OutputFormat = "json",
            IncludeFilters = 
            {
                new Aws.CloudWatch.Inputs.MetricStreamIncludeFilterArgs
                {
                    Namespace = "AWS/EC2",
                },
                new Aws.CloudWatch.Inputs.MetricStreamIncludeFilterArgs
                {
                    Namespace = "AWS/EBS",
                },
            },
        });
        // https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
        var metricStreamToFirehoseRolePolicy = new Aws.Iam.RolePolicy("metricStreamToFirehoseRolePolicy", new Aws.Iam.RolePolicyArgs
        {
            Role = metricStreamToFirehoseRole.Id,
            Policy = s3Stream.Arn.Apply(arn => @$"{{
    ""Version"": ""2012-10-17"",
    ""Statement"": [
        {{
            ""Effect"": ""Allow"",
            ""Action"": [
                ""firehose:PutRecord"",
                ""firehose:PutRecordBatch""
            ],
            ""Resource"": ""{arn}""
        }}
    ]
}}
"),
        });
        var bucketAcl = new Aws.S3.BucketAclV2("bucketAcl", new Aws.S3.BucketAclV2Args
        {
            Bucket = bucket.Id,
            Acl = "private",
        });
        var firehoseToS3RolePolicy = new Aws.Iam.RolePolicy("firehoseToS3RolePolicy", new Aws.Iam.RolePolicyArgs
        {
            Role = firehoseToS3Role.Id,
            Policy = Output.Tuple(bucket.Arn, bucket.Arn).Apply(values =>
            {
                var bucketArn = values.Item1;
                var bucketArn1 = values.Item2;
                return @$"{{
    ""Version"": ""2012-10-17"",
    ""Statement"": [
        {{
            ""Effect"": ""Allow"",
            ""Action"": [
                ""s3:AbortMultipartUpload"",
                ""s3:GetBucketLocation"",
                ""s3:GetObject"",
                ""s3:ListBucket"",
                ""s3:ListBucketMultipartUploads"",
                ""s3:PutObject""
            ],
            ""Resource"": [
                ""{bucketArn}"",
                ""{bucketArn1}/*""
            ]
        }}
    ]
}}
";
            }),
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudwatch"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/kinesis"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		metricStreamToFirehoseRole, err := iam.NewRole(ctx, "metricStreamToFirehoseRole", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.Any(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\": \"2012-10-17\",\n", "  \"Statement\": [\n", "    {\n", "      \"Action\": \"sts:AssumeRole\",\n", "      \"Principal\": {\n", "        \"Service\": \"streams.metrics.cloudwatch.amazonaws.com\"\n", "      },\n", "      \"Effect\": \"Allow\",\n", "      \"Sid\": \"\"\n", "    }\n", "  ]\n", "}\n")),
		})
		if err != nil {
			return err
		}
		bucket, err := s3.NewBucketV2(ctx, "bucket", nil)
		if err != nil {
			return err
		}
		firehoseToS3Role, err := iam.NewRole(ctx, "firehoseToS3Role", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.Any(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\": \"2012-10-17\",\n", "  \"Statement\": [\n", "    {\n", "      \"Action\": \"sts:AssumeRole\",\n", "      \"Principal\": {\n", "        \"Service\": \"firehose.amazonaws.com\"\n", "      },\n", "      \"Effect\": \"Allow\",\n", "      \"Sid\": \"\"\n", "    }\n", "  ]\n", "}\n")),
		})
		if err != nil {
			return err
		}
		s3Stream, err := kinesis.NewFirehoseDeliveryStream(ctx, "s3Stream", &kinesis.FirehoseDeliveryStreamArgs{
			Destination: pulumi.String("s3"),
			S3Configuration: &kinesis.FirehoseDeliveryStreamS3ConfigurationArgs{
				RoleArn:   firehoseToS3Role.Arn,
				BucketArn: bucket.Arn,
			},
		})
		if err != nil {
			return err
		}
		_, err = cloudwatch.NewMetricStream(ctx, "main", &cloudwatch.MetricStreamArgs{
			RoleArn:      metricStreamToFirehoseRole.Arn,
			FirehoseArn:  s3Stream.Arn,
			OutputFormat: pulumi.String("json"),
			IncludeFilters: cloudwatch.MetricStreamIncludeFilterArray{
				&cloudwatch.MetricStreamIncludeFilterArgs{
					Namespace: pulumi.String("AWS/EC2"),
				},
				&cloudwatch.MetricStreamIncludeFilterArgs{
					Namespace: pulumi.String("AWS/EBS"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = iam.NewRolePolicy(ctx, "metricStreamToFirehoseRolePolicy", &iam.RolePolicyArgs{
			Role: metricStreamToFirehoseRole.ID(),
			Policy: s3Stream.Arn.ApplyT(func(arn string) (string, error) {
				return fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "    \"Version\": \"2012-10-17\",\n", "    \"Statement\": [\n", "        {\n", "            \"Effect\": \"Allow\",\n", "            \"Action\": [\n", "                \"firehose:PutRecord\",\n", "                \"firehose:PutRecordBatch\"\n", "            ],\n", "            \"Resource\": \"", arn, "\"\n", "        }\n", "    ]\n", "}\n"), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAclV2(ctx, "bucketAcl", &s3.BucketAclV2Args{
			Bucket: bucket.ID(),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		_, err = iam.NewRolePolicy(ctx, "firehoseToS3RolePolicy", &iam.RolePolicyArgs{
			Role: firehoseToS3Role.ID(),
			Policy: pulumi.All(bucket.Arn, bucket.Arn).ApplyT(func(_args []interface{}) (string, error) {
				bucketArn := _args[0].(string)
				bucketArn1 := _args[1].(string)
				return fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "    \"Version\": \"2012-10-17\",\n", "    \"Statement\": [\n", "        {\n", "            \"Effect\": \"Allow\",\n", "            \"Action\": [\n", "                \"s3:AbortMultipartUpload\",\n", "                \"s3:GetBucketLocation\",\n", "                \"s3:GetObject\",\n", "                \"s3:ListBucket\",\n", "                \"s3:ListBucketMultipartUploads\",\n", "                \"s3:PutObject\"\n", "            ],\n", "            \"Resource\": [\n", "                \"", bucketArn, "\",\n", "                \"", bucketArn1, "/*\"\n", "            ]\n", "        }\n", "    ]\n", "}\n"), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var metricStreamToFirehoseRole = new Role("metricStreamToFirehoseRole", RoleArgs.builder()        
            .assumeRolePolicy("""
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "streams.metrics.cloudwatch.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
            """)
            .build());

        var bucket = new BucketV2("bucket");

        var firehoseToS3Role = new Role("firehoseToS3Role", RoleArgs.builder()        
            .assumeRolePolicy("""
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "firehose.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
            """)
            .build());

        var s3Stream = new FirehoseDeliveryStream("s3Stream", FirehoseDeliveryStreamArgs.builder()        
            .destination("s3")
            .s3Configuration(FirehoseDeliveryStreamS3ConfigurationArgs.builder()
                .roleArn(firehoseToS3Role.arn())
                .bucketArn(bucket.arn())
                .build())
            .build());

        var main = new MetricStream("main", MetricStreamArgs.builder()        
            .roleArn(metricStreamToFirehoseRole.arn())
            .firehoseArn(s3Stream.arn())
            .outputFormat("json")
            .includeFilters(            
                MetricStreamIncludeFilterArgs.builder()
                    .namespace("AWS/EC2")
                    .build(),
                MetricStreamIncludeFilterArgs.builder()
                    .namespace("AWS/EBS")
                    .build())
            .build());

        var metricStreamToFirehoseRolePolicy = new RolePolicy("metricStreamToFirehoseRolePolicy", RolePolicyArgs.builder()        
            .role(metricStreamToFirehoseRole.id())
            .policy(s3Stream.arn().apply(arn -> """
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "firehose:PutRecord",
                "firehose:PutRecordBatch"
            ],
            "Resource": "%s"
        }
    ]
}
", arn)))
            .build());

        var bucketAcl = new BucketAclV2("bucketAcl", BucketAclV2Args.builder()        
            .bucket(bucket.id())
            .acl("private")
            .build());

        var firehoseToS3RolePolicy = new RolePolicy("firehoseToS3RolePolicy", RolePolicyArgs.builder()        
            .role(firehoseToS3Role.id())
            .policy(Output.tuple(bucket.arn(), bucket.arn()).apply(values -> {
                var bucketArn = values.t1;
                var bucketArn1 = values.t2;
                return """
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:AbortMultipartUpload",
                "s3:GetBucketLocation",
                "s3:GetObject",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:PutObject"
            ],
            "Resource": [
                "%s",
                "%s/*"
            ]
        }
    ]
}
", bucketArn,bucketArn1);
            }))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

# https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
metric_stream_to_firehose_role = aws.iam.Role("metricStreamToFirehoseRole", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "streams.metrics.cloudwatch.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
""")
bucket = aws.s3.BucketV2("bucket")
firehose_to_s3_role = aws.iam.Role("firehoseToS3Role", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "firehose.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
""")
s3_stream = aws.kinesis.FirehoseDeliveryStream("s3Stream",
    destination="s3",
    s3_configuration=aws.kinesis.FirehoseDeliveryStreamS3ConfigurationArgs(
        role_arn=firehose_to_s3_role.arn,
        bucket_arn=bucket.arn,
    ))
main = aws.cloudwatch.MetricStream("main",
    role_arn=metric_stream_to_firehose_role.arn,
    firehose_arn=s3_stream.arn,
    output_format="json",
    include_filters=[
        aws.cloudwatch.MetricStreamIncludeFilterArgs(
            namespace="AWS/EC2",
        ),
        aws.cloudwatch.MetricStreamIncludeFilterArgs(
            namespace="AWS/EBS",
        ),
    ])
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
metric_stream_to_firehose_role_policy = aws.iam.RolePolicy("metricStreamToFirehoseRolePolicy",
    role=metric_stream_to_firehose_role.id,
    policy=s3_stream.arn.apply(lambda arn: f"""{{
    "Version": "2012-10-17",
    "Statement": [
        {{
            "Effect": "Allow",
            "Action": [
                "firehose:PutRecord",
                "firehose:PutRecordBatch"
            ],
            "Resource": "{arn}"
        }}
    ]
}}
"""))
bucket_acl = aws.s3.BucketAclV2("bucketAcl",
    bucket=bucket.id,
    acl="private")
firehose_to_s3_role_policy = aws.iam.RolePolicy("firehoseToS3RolePolicy",
    role=firehose_to_s3_role.id,
    policy=pulumi.Output.all(bucket.arn, bucket.arn).apply(lambda bucketArn, bucketArn1: f"""{{
    "Version": "2012-10-17",
    "Statement": [
        {{
            "Effect": "Allow",
            "Action": [
                "s3:AbortMultipartUpload",
                "s3:GetBucketLocation",
                "s3:GetObject",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:PutObject"
            ],
            "Resource": [
                "{bucket_arn}",
                "{bucket_arn1}/*"
            ]
        }}
    ]
}}
"""))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
const metricStreamToFirehoseRole = new aws.iam.Role("metricStreamToFirehoseRole", {assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "streams.metrics.cloudwatch.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`});
const bucket = new aws.s3.BucketV2("bucket", {});
const firehoseToS3Role = new aws.iam.Role("firehoseToS3Role", {assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "firehose.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`});
const s3Stream = new aws.kinesis.FirehoseDeliveryStream("s3Stream", {
    destination: "s3",
    s3Configuration: {
        roleArn: firehoseToS3Role.arn,
        bucketArn: bucket.arn,
    },
});
const main = new aws.cloudwatch.MetricStream("main", {
    roleArn: metricStreamToFirehoseRole.arn,
    firehoseArn: s3Stream.arn,
    outputFormat: "json",
    includeFilters: [
        {
            namespace: "AWS/EC2",
        },
        {
            namespace: "AWS/EBS",
        },
    ],
});
// https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-metric-streams-trustpolicy.html
const metricStreamToFirehoseRolePolicy = new aws.iam.RolePolicy("metricStreamToFirehoseRolePolicy", {
    role: metricStreamToFirehoseRole.id,
    policy: pulumi.interpolate`{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "firehose:PutRecord",
                "firehose:PutRecordBatch"
            ],
            "Resource": "${s3Stream.arn}"
        }
    ]
}
`,
});
const bucketAcl = new aws.s3.BucketAclV2("bucketAcl", {
    bucket: bucket.id,
    acl: "private",
});
const firehoseToS3RolePolicy = new aws.iam.RolePolicy("firehoseToS3RolePolicy", {
    role: firehoseToS3Role.id,
    policy: pulumi.interpolate`{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:AbortMultipartUpload",
                "s3:GetBucketLocation",
                "s3:GetObject",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:PutObject"
            ],
            "Resource": [
                "${bucket.arn}",
                "${bucket.arn}/*"
            ]
        }
    ]
}
`,
});
resources:
  main:
    type: aws:cloudwatch:MetricStream
    properties:
      roleArn: ${metricStreamToFirehoseRole.arn}
      firehoseArn: ${s3Stream.arn}
      outputFormat: json
      includeFilters:
        - namespace: AWS/EC2
        - namespace: AWS/EBS
  metricStreamToFirehoseRole:
    type: aws:iam:Role
    properties:
      assumeRolePolicy: |
        {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Principal": {
                "Service": "streams.metrics.cloudwatch.amazonaws.com"
              },
              "Effect": "Allow",
              "Sid": ""
            }
          ]
        }        
  metricStreamToFirehoseRolePolicy:
    type: aws:iam:RolePolicy
    properties:
      role: ${metricStreamToFirehoseRole.id}
      policy: |
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Action": [
                        "firehose:PutRecord",
                        "firehose:PutRecordBatch"
                    ],
                    "Resource": "${s3Stream.arn}"
                }
            ]
        }        
  bucket:
    type: aws:s3:BucketV2
  bucketAcl:
    type: aws:s3:BucketAclV2
    properties:
      bucket: ${bucket.id}
      acl: private
  firehoseToS3Role:
    type: aws:iam:Role
    properties:
      assumeRolePolicy: |
        {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Principal": {
                "Service": "firehose.amazonaws.com"
              },
              "Effect": "Allow",
              "Sid": ""
            }
          ]
        }        
  firehoseToS3RolePolicy:
    type: aws:iam:RolePolicy
    properties:
      role: ${firehoseToS3Role.id}
      policy: |
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Action": [
                        "s3:AbortMultipartUpload",
                        "s3:GetBucketLocation",
                        "s3:GetObject",
                        "s3:ListBucket",
                        "s3:ListBucketMultipartUploads",
                        "s3:PutObject"
                    ],
                    "Resource": [
                        "${bucket.arn}",
                        "${bucket.arn}/*"
                    ]
                }
            ]
        }        
  s3Stream:
    type: aws:kinesis:FirehoseDeliveryStream
    properties:
      destination: s3
      s3Configuration:
        roleArn: ${firehoseToS3Role.arn}
        bucketArn: ${bucket.arn}

Additional Statistics

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var main = new Aws.CloudWatch.MetricStream("main", new Aws.CloudWatch.MetricStreamArgs
        {
            RoleArn = aws_iam_role.Metric_stream_to_firehose.Arn,
            FirehoseArn = aws_kinesis_firehose_delivery_stream.S3_stream.Arn,
            OutputFormat = "json",
            StatisticsConfigurations = 
            {
                new Aws.CloudWatch.Inputs.MetricStreamStatisticsConfigurationArgs
                {
                    AdditionalStatistics = 
                    {
                        "p1",
                        "tm99",
                    },
                    IncludeMetrics = 
                    {
                        new Aws.CloudWatch.Inputs.MetricStreamStatisticsConfigurationIncludeMetricArgs
                        {
                            MetricName = "CPUUtilization",
                            Namespace = "AWS/EC2",
                        },
                    },
                },
                new Aws.CloudWatch.Inputs.MetricStreamStatisticsConfigurationArgs
                {
                    AdditionalStatistics = 
                    {
                        "TS(50.5:)",
                    },
                    IncludeMetrics = 
                    {
                        new Aws.CloudWatch.Inputs.MetricStreamStatisticsConfigurationIncludeMetricArgs
                        {
                            MetricName = "CPUUtilization",
                            Namespace = "AWS/EC2",
                        },
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cloudwatch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudwatch.NewMetricStream(ctx, "main", &cloudwatch.MetricStreamArgs{
			RoleArn:      pulumi.Any(aws_iam_role.Metric_stream_to_firehose.Arn),
			FirehoseArn:  pulumi.Any(aws_kinesis_firehose_delivery_stream.S3_stream.Arn),
			OutputFormat: pulumi.String("json"),
			StatisticsConfigurations: cloudwatch.MetricStreamStatisticsConfigurationArray{
				&cloudwatch.MetricStreamStatisticsConfigurationArgs{
					AdditionalStatistics: pulumi.StringArray{
						pulumi.String("p1"),
						pulumi.String("tm99"),
					},
					IncludeMetrics: cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArray{
						&cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArgs{
							MetricName: pulumi.String("CPUUtilization"),
							Namespace:  pulumi.String("AWS/EC2"),
						},
					},
				},
				&cloudwatch.MetricStreamStatisticsConfigurationArgs{
					AdditionalStatistics: pulumi.StringArray{
						pulumi.String("TS(50.5:)"),
					},
					IncludeMetrics: cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArray{
						&cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArgs{
							MetricName: pulumi.String("CPUUtilization"),
							Namespace:  pulumi.String("AWS/EC2"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var main = new MetricStream("main", MetricStreamArgs.builder()        
            .roleArn(aws_iam_role.metric_stream_to_firehose().arn())
            .firehoseArn(aws_kinesis_firehose_delivery_stream.s3_stream().arn())
            .outputFormat("json")
            .statisticsConfigurations(            
                MetricStreamStatisticsConfigurationArgs.builder()
                    .additionalStatistics(                    
                        "p1",
                        "tm99")
                    .includeMetrics(MetricStreamStatisticsConfigurationIncludeMetricArgs.builder()
                        .metricName("CPUUtilization")
                        .namespace("AWS/EC2")
                        .build())
                    .build(),
                MetricStreamStatisticsConfigurationArgs.builder()
                    .additionalStatistics("TS(50.5:)")
                    .includeMetrics(MetricStreamStatisticsConfigurationIncludeMetricArgs.builder()
                        .metricName("CPUUtilization")
                        .namespace("AWS/EC2")
                        .build())
                    .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

main = aws.cloudwatch.MetricStream("main",
    role_arn=aws_iam_role["metric_stream_to_firehose"]["arn"],
    firehose_arn=aws_kinesis_firehose_delivery_stream["s3_stream"]["arn"],
    output_format="json",
    statistics_configurations=[
        aws.cloudwatch.MetricStreamStatisticsConfigurationArgs(
            additional_statistics=[
                "p1",
                "tm99",
            ],
            include_metrics=[aws.cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArgs(
                metric_name="CPUUtilization",
                namespace="AWS/EC2",
            )],
        ),
        aws.cloudwatch.MetricStreamStatisticsConfigurationArgs(
            additional_statistics=["TS(50.5:)"],
            include_metrics=[aws.cloudwatch.MetricStreamStatisticsConfigurationIncludeMetricArgs(
                metric_name="CPUUtilization",
                namespace="AWS/EC2",
            )],
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const main = new aws.cloudwatch.MetricStream("main", {
    roleArn: aws_iam_role.metric_stream_to_firehose.arn,
    firehoseArn: aws_kinesis_firehose_delivery_stream.s3_stream.arn,
    outputFormat: "json",
    statisticsConfigurations: [
        {
            additionalStatistics: [
                "p1",
                "tm99",
            ],
            includeMetrics: [{
                metricName: "CPUUtilization",
                namespace: "AWS/EC2",
            }],
        },
        {
            additionalStatistics: ["TS(50.5:)"],
            includeMetrics: [{
                metricName: "CPUUtilization",
                namespace: "AWS/EC2",
            }],
        },
    ],
});
resources:
  main:
    type: aws:cloudwatch:MetricStream
    properties:
      roleArn: ${aws_iam_role.metric_stream_to_firehose.arn}
      firehoseArn: ${aws_kinesis_firehose_delivery_stream.s3_stream.arn}
      outputFormat: json
      statisticsConfigurations:
        - additionalStatistics:
            - p1
            - tm99
          includeMetrics:
            - metricName: CPUUtilization
              namespace: AWS/EC2
        - additionalStatistics:
            - TS(50.5:)
          includeMetrics:
            - metricName: CPUUtilization
              namespace: AWS/EC2

Create a MetricStream Resource

new MetricStream(name: string, args: MetricStreamArgs, opts?: CustomResourceOptions);
@overload
def MetricStream(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 exclude_filters: Optional[Sequence[MetricStreamExcludeFilterArgs]] = None,
                 firehose_arn: Optional[str] = None,
                 include_filters: Optional[Sequence[MetricStreamIncludeFilterArgs]] = None,
                 name: Optional[str] = None,
                 name_prefix: Optional[str] = None,
                 output_format: Optional[str] = None,
                 role_arn: Optional[str] = None,
                 statistics_configurations: Optional[Sequence[MetricStreamStatisticsConfigurationArgs]] = None,
                 tags: Optional[Mapping[str, str]] = None)
@overload
def MetricStream(resource_name: str,
                 args: MetricStreamArgs,
                 opts: Optional[ResourceOptions] = None)
func NewMetricStream(ctx *Context, name string, args MetricStreamArgs, opts ...ResourceOption) (*MetricStream, error)
public MetricStream(string name, MetricStreamArgs args, CustomResourceOptions? opts = null)
public MetricStream(String name, MetricStreamArgs args)
public MetricStream(String name, MetricStreamArgs args, CustomResourceOptions options)
type: aws:cloudwatch:MetricStream
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args MetricStreamArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args MetricStreamArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MetricStreamArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MetricStreamArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args MetricStreamArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

MetricStream Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The MetricStream resource accepts the following input properties:

FirehoseArn string

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

OutputFormat string

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

RoleArn string

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

ExcludeFilters List<MetricStreamExcludeFilterArgs>

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

IncludeFilters List<MetricStreamIncludeFilterArgs>

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

Name string
NamePrefix string

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

StatisticsConfigurations List<MetricStreamStatisticsConfigurationArgs>

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

Tags Dictionary<string, string>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

FirehoseArn string

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

OutputFormat string

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

RoleArn string

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

ExcludeFilters []MetricStreamExcludeFilterArgs

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

IncludeFilters []MetricStreamIncludeFilterArgs

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

Name string
NamePrefix string

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

StatisticsConfigurations []MetricStreamStatisticsConfigurationArgs

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

Tags map[string]string

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

firehoseArn String

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

outputFormat String

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

roleArn String

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

excludeFilters List<MetricStreamExcludeFilterArgs>

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

includeFilters List<MetricStreamIncludeFilterArgs>

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

name String
namePrefix String

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

statisticsConfigurations List<MetricStreamStatisticsConfigurationArgs>

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags Map<String,String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

firehoseArn string

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

outputFormat string

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

roleArn string

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

excludeFilters MetricStreamExcludeFilterArgs[]

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

includeFilters MetricStreamIncludeFilterArgs[]

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

name string
namePrefix string

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

statisticsConfigurations MetricStreamStatisticsConfigurationArgs[]

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags {[key: string]: string}

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

firehose_arn str

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

output_format str

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

role_arn str

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

exclude_filters Sequence[MetricStreamExcludeFilterArgs]

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

include_filters Sequence[MetricStreamIncludeFilterArgs]

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

name str
name_prefix str

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

statistics_configurations Sequence[MetricStreamStatisticsConfigurationArgs]

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags Mapping[str, str]

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

firehoseArn String

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

outputFormat String

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

roleArn String

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

excludeFilters List<Property Map>

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

includeFilters List<Property Map>

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

name String
namePrefix String

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

statisticsConfigurations List<Property Map>

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags Map<String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the MetricStream resource produces the following output properties:

Arn string

ARN of the metric stream.

CreationDate string

Date and time in RFC3339 format that the metric stream was created.

Id string

The provider-assigned unique ID for this managed resource.

LastUpdateDate string

Date and time in RFC3339 format that the metric stream was last updated.

State string

State of the metric stream. Possible values are running and stopped.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

ARN of the metric stream.

CreationDate string

Date and time in RFC3339 format that the metric stream was created.

Id string

The provider-assigned unique ID for this managed resource.

LastUpdateDate string

Date and time in RFC3339 format that the metric stream was last updated.

State string

State of the metric stream. Possible values are running and stopped.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the metric stream.

creationDate String

Date and time in RFC3339 format that the metric stream was created.

id String

The provider-assigned unique ID for this managed resource.

lastUpdateDate String

Date and time in RFC3339 format that the metric stream was last updated.

state String

State of the metric stream. Possible values are running and stopped.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

ARN of the metric stream.

creationDate string

Date and time in RFC3339 format that the metric stream was created.

id string

The provider-assigned unique ID for this managed resource.

lastUpdateDate string

Date and time in RFC3339 format that the metric stream was last updated.

state string

State of the metric stream. Possible values are running and stopped.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

ARN of the metric stream.

creation_date str

Date and time in RFC3339 format that the metric stream was created.

id str

The provider-assigned unique ID for this managed resource.

last_update_date str

Date and time in RFC3339 format that the metric stream was last updated.

state str

State of the metric stream. Possible values are running and stopped.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the metric stream.

creationDate String

Date and time in RFC3339 format that the metric stream was created.

id String

The provider-assigned unique ID for this managed resource.

lastUpdateDate String

Date and time in RFC3339 format that the metric stream was last updated.

state String

State of the metric stream. Possible values are running and stopped.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up an Existing MetricStream Resource

Get an existing MetricStream resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MetricStreamState, opts?: CustomResourceOptions): MetricStream
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        creation_date: Optional[str] = None,
        exclude_filters: Optional[Sequence[MetricStreamExcludeFilterArgs]] = None,
        firehose_arn: Optional[str] = None,
        include_filters: Optional[Sequence[MetricStreamIncludeFilterArgs]] = None,
        last_update_date: Optional[str] = None,
        name: Optional[str] = None,
        name_prefix: Optional[str] = None,
        output_format: Optional[str] = None,
        role_arn: Optional[str] = None,
        state: Optional[str] = None,
        statistics_configurations: Optional[Sequence[MetricStreamStatisticsConfigurationArgs]] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> MetricStream
func GetMetricStream(ctx *Context, name string, id IDInput, state *MetricStreamState, opts ...ResourceOption) (*MetricStream, error)
public static MetricStream Get(string name, Input<string> id, MetricStreamState? state, CustomResourceOptions? opts = null)
public static MetricStream get(String name, Output<String> id, MetricStreamState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

ARN of the metric stream.

CreationDate string

Date and time in RFC3339 format that the metric stream was created.

ExcludeFilters List<MetricStreamExcludeFilterArgs>

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

FirehoseArn string

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

IncludeFilters List<MetricStreamIncludeFilterArgs>

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

LastUpdateDate string

Date and time in RFC3339 format that the metric stream was last updated.

Name string
NamePrefix string

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

OutputFormat string

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

RoleArn string

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

State string

State of the metric stream. Possible values are running and stopped.

StatisticsConfigurations List<MetricStreamStatisticsConfigurationArgs>

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

Tags Dictionary<string, string>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

ARN of the metric stream.

CreationDate string

Date and time in RFC3339 format that the metric stream was created.

ExcludeFilters []MetricStreamExcludeFilterArgs

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

FirehoseArn string

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

IncludeFilters []MetricStreamIncludeFilterArgs

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

LastUpdateDate string

Date and time in RFC3339 format that the metric stream was last updated.

Name string
NamePrefix string

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

OutputFormat string

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

RoleArn string

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

State string

State of the metric stream. Possible values are running and stopped.

StatisticsConfigurations []MetricStreamStatisticsConfigurationArgs

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

Tags map[string]string

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the metric stream.

creationDate String

Date and time in RFC3339 format that the metric stream was created.

excludeFilters List<MetricStreamExcludeFilterArgs>

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

firehoseArn String

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

includeFilters List<MetricStreamIncludeFilterArgs>

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

lastUpdateDate String

Date and time in RFC3339 format that the metric stream was last updated.

name String
namePrefix String

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

outputFormat String

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

roleArn String

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

state String

State of the metric stream. Possible values are running and stopped.

statisticsConfigurations List<MetricStreamStatisticsConfigurationArgs>

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags Map<String,String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

ARN of the metric stream.

creationDate string

Date and time in RFC3339 format that the metric stream was created.

excludeFilters MetricStreamExcludeFilterArgs[]

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

firehoseArn string

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

includeFilters MetricStreamIncludeFilterArgs[]

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

lastUpdateDate string

Date and time in RFC3339 format that the metric stream was last updated.

name string
namePrefix string

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

outputFormat string

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

roleArn string

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

state string

State of the metric stream. Possible values are running and stopped.

statisticsConfigurations MetricStreamStatisticsConfigurationArgs[]

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags {[key: string]: string}

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

ARN of the metric stream.

creation_date str

Date and time in RFC3339 format that the metric stream was created.

exclude_filters Sequence[MetricStreamExcludeFilterArgs]

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

firehose_arn str

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

include_filters Sequence[MetricStreamIncludeFilterArgs]

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

last_update_date str

Date and time in RFC3339 format that the metric stream was last updated.

name str
name_prefix str

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

output_format str

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

role_arn str

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

state str

State of the metric stream. Possible values are running and stopped.

statistics_configurations Sequence[MetricStreamStatisticsConfigurationArgs]

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags Mapping[str, str]

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

ARN of the metric stream.

creationDate String

Date and time in RFC3339 format that the metric stream was created.

excludeFilters List<Property Map>

List of exclusive metric filters. If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here. Conflicts with include_filter.

firehoseArn String

ARN of the Amazon Kinesis Firehose delivery stream to use for this metric stream.

includeFilters List<Property Map>

List of inclusive metric filters. If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here. Conflicts with exclude_filter.

lastUpdateDate String

Date and time in RFC3339 format that the metric stream was last updated.

name String
namePrefix String

Creates a unique friendly name beginning with the specified prefix. Conflicts with name.

outputFormat String

Output format for the stream. Possible values are json and opentelemetry0.7. For more information about output formats, see Metric streams output formats.

roleArn String

ARN of the IAM role that this metric stream will use to access Amazon Kinesis Firehose resources. For more information about role permissions, see Trust between CloudWatch and Kinesis Data Firehose.

state String

State of the metric stream. Possible values are running and stopped.

statisticsConfigurations List<Property Map>

For each entry in this array, you specify one or more metrics and the list of additional statistics to stream for those metrics. The additional statistics that you can stream depend on the stream's output_format. If the OutputFormat is json, you can stream any additional statistic that is supported by CloudWatch, listed in CloudWatch statistics definitions. If the OutputFormat is opentelemetry0.7, you can stream percentile statistics (p99 etc.). See details below.

tags Map<String>

Map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Supporting Types

MetricStreamExcludeFilter

Namespace string

The namespace of the metric.

Namespace string

The namespace of the metric.

namespace String

The namespace of the metric.

namespace string

The namespace of the metric.

namespace str

The namespace of the metric.

namespace String

The namespace of the metric.

MetricStreamIncludeFilter

Namespace string

The namespace of the metric.

Namespace string

The namespace of the metric.

namespace String

The namespace of the metric.

namespace string

The namespace of the metric.

namespace str

The namespace of the metric.

namespace String

The namespace of the metric.

MetricStreamStatisticsConfiguration

AdditionalStatistics List<string>

The additional statistics to stream for the metrics listed in include_metrics.

IncludeMetrics List<MetricStreamStatisticsConfigurationIncludeMetric>

An array that defines the metrics that are to have additional statistics streamed. See details below.

AdditionalStatistics []string

The additional statistics to stream for the metrics listed in include_metrics.

IncludeMetrics []MetricStreamStatisticsConfigurationIncludeMetric

An array that defines the metrics that are to have additional statistics streamed. See details below.

additionalStatistics List<String>

The additional statistics to stream for the metrics listed in include_metrics.

includeMetrics List<MetricStreamStatisticsConfigurationIncludeMetric>

An array that defines the metrics that are to have additional statistics streamed. See details below.

additionalStatistics string[]

The additional statistics to stream for the metrics listed in include_metrics.

includeMetrics MetricStreamStatisticsConfigurationIncludeMetric[]

An array that defines the metrics that are to have additional statistics streamed. See details below.

additional_statistics Sequence[str]

The additional statistics to stream for the metrics listed in include_metrics.

include_metrics Sequence[MetricStreamStatisticsConfigurationIncludeMetric]

An array that defines the metrics that are to have additional statistics streamed. See details below.

additionalStatistics List<String>

The additional statistics to stream for the metrics listed in include_metrics.

includeMetrics List<Property Map>

An array that defines the metrics that are to have additional statistics streamed. See details below.

MetricStreamStatisticsConfigurationIncludeMetric

MetricName string

The name of the metric.

Namespace string

The namespace of the metric.

MetricName string

The name of the metric.

Namespace string

The namespace of the metric.

metricName String

The name of the metric.

namespace String

The namespace of the metric.

metricName string

The name of the metric.

namespace string

The namespace of the metric.

metric_name str

The name of the metric.

namespace str

The namespace of the metric.

metricName String

The name of the metric.

namespace String

The namespace of the metric.

Import

CloudWatch metric streams can be imported using the name, e.g.,

 $ pulumi import aws:cloudwatch/metricStream:MetricStream sample <name>

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.