CfnMetricStreamProps Struct
Properties for defining a CfnMetricStream.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const cfnMetricStreamProps: cloudwatch.CfnMetricStreamProps = {
firehoseArn: 'firehoseArn',
outputFormat: 'outputFormat',
roleArn: 'roleArn',
// the properties below are optional
excludeFilters: [{
namespace: 'namespace',
// the properties below are optional
metricNames: ['metricNames'],
}],
includeFilters: [{
namespace: 'namespace',
// the properties below are optional
metricNames: ['metricNames'],
}],
includeLinkedAccountsMetrics: false,
name: 'name',
statisticsConfigurations: [{
additionalStatistics: ['additionalStatistics'],
includeMetrics: [{
metricName: 'metricName',
namespace: 'namespace',
}],
}],
tags: [{
key: 'key',
value: 'value',
}],
};
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudwatch as cloudwatch
cfn_metric_stream_props = cloudwatch.CfnMetricStreamProps(
firehose_arn="firehoseArn",
output_format="outputFormat",
role_arn="roleArn",
# the properties below are optional
exclude_filters=[cloudwatch.CfnMetricStream.MetricStreamFilterProperty(
namespace="namespace",
# the properties below are optional
metric_names=["metricNames"]
)],
include_filters=[cloudwatch.CfnMetricStream.MetricStreamFilterProperty(
namespace="namespace",
# the properties below are optional
metric_names=["metricNames"]
)],
include_linked_accounts_metrics=False,
name="name",
statistics_configurations=[cloudwatch.CfnMetricStream.MetricStreamStatisticsConfigurationProperty(
additional_statistics=["additionalStatistics"],
include_metrics=[cloudwatch.CfnMetricStream.MetricStreamStatisticsMetricProperty(
metric_name="metricName",
namespace="namespace"
)]
)],
tags=[CfnTag(
key="key",
value="value"
)]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudwatch.*;
CfnMetricStreamProps cfnMetricStreamProps = CfnMetricStreamProps.builder()
.firehoseArn("firehoseArn")
.outputFormat("outputFormat")
.roleArn("roleArn")
// the properties below are optional
.excludeFilters(List.of(MetricStreamFilterProperty.builder()
.namespace("namespace")
// the properties below are optional
.metricNames(List.of("metricNames"))
.build()))
.includeFilters(List.of(MetricStreamFilterProperty.builder()
.namespace("namespace")
// the properties below are optional
.metricNames(List.of("metricNames"))
.build()))
.includeLinkedAccountsMetrics(false)
.name("name")
.statisticsConfigurations(List.of(MetricStreamStatisticsConfigurationProperty.builder()
.additionalStatistics(List.of("additionalStatistics"))
.includeMetrics(List.of(MetricStreamStatisticsMetricProperty.builder()
.metricName("metricName")
.namespace("namespace")
.build()))
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudWatch;
var cfnMetricStreamProps = new CfnMetricStreamProps {
FirehoseArn = "firehoseArn",
OutputFormat = "outputFormat",
RoleArn = "roleArn",
// the properties below are optional
ExcludeFilters = new [] { new MetricStreamFilterProperty {
Namespace = "namespace",
// the properties below are optional
MetricNames = new [] { "metricNames" }
} },
IncludeFilters = new [] { new MetricStreamFilterProperty {
Namespace = "namespace",
// the properties below are optional
MetricNames = new [] { "metricNames" }
} },
IncludeLinkedAccountsMetrics = false,
Name = "name",
StatisticsConfigurations = new [] { new MetricStreamStatisticsConfigurationProperty {
AdditionalStatistics = new [] { "additionalStatistics" },
IncludeMetrics = new [] { new MetricStreamStatisticsMetricProperty {
MetricName = "metricName",
Namespace = "namespace"
} }
} },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnMetricStreamProps := &CfnMetricStreamProps{
FirehoseArn: jsii.String("firehoseArn"),
OutputFormat: jsii.String("outputFormat"),
RoleArn: jsii.String("roleArn"),
// the properties below are optional
ExcludeFilters: []interface{}{
&MetricStreamFilterProperty{
Namespace: jsii.String("namespace"),
// the properties below are optional
MetricNames: []*string{
jsii.String("metricNames"),
},
},
},
IncludeFilters: []interface{}{
&MetricStreamFilterProperty{
Namespace: jsii.String("namespace"),
// the properties below are optional
MetricNames: []*string{
jsii.String("metricNames"),
},
},
},
IncludeLinkedAccountsMetrics: jsii.Boolean(false),
Name: jsii.String("name"),
StatisticsConfigurations: []interface{}{
&MetricStreamStatisticsConfigurationProperty{
AdditionalStatistics: []*string{
jsii.String("additionalStatistics"),
},
IncludeMetrics: []interface{}{
&MetricStreamStatisticsMetricProperty{
MetricName: jsii.String("metricName"),
Namespace: jsii.String("namespace"),
},
},
},
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
excludeFiltersoptionalIResolvable | IResolvable | CfnMetricStream.MetricStreamFilterProperty[]exclude_filtersoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, MetricStreamFilterProperty]]]excludeFiltersoptionalIResolvableExcludeFiltersoptionalIResolvableExcludeFiltersoptionalinterface{}#notes
You cannot specify both IncludeFilters and ExcludeFilters in the same metric stream.
When you modify the IncludeFilters or ExcludeFilters of an existing metric stream in any way, the metric stream is effectively restarted, so after such a change you will get only the datapoints that have a timestamp after the time of the update.
firehoseArnstring | IDeliveryStreamReffirehose_arntyping.Union[str, IDeliveryStreamRef]firehoseArnStringFirehoseArnstringFirehoseArninterface{}required#This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.
includeFiltersoptionalIResolvable | IResolvable | CfnMetricStream.MetricStreamFilterProperty[]include_filtersoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, MetricStreamFilterProperty]]]includeFiltersoptionalIResolvableIncludeFiltersoptionalIResolvableIncludeFiltersoptionalinterface{}#notes
You cannot specify both IncludeFilters and ExcludeFilters in the same metric stream.
When you modify the IncludeFilters or ExcludeFilters of an existing metric stream in any way, the metric stream is effectively restarted, so after such a change you will get only the datapoints that have a timestamp after the time of the update.
includeLinkedAccountsMetricsoptionalboolean | IResolvableinclude_linked_accounts_metricsoptionaltyping.Union[bool, IResolvable]includeLinkedAccountsMetricsoptionalBooleanIncludeLinkedAccountsMetricsoptionalboolIncludeLinkedAccountsMetricsoptionalinterface{}#The default is false .
For more information about linking accounts, see CloudWatch cross-account observability
The name must be different than the names of other metric streams in this account and Region.
If you are updating a metric stream, specify the name of that stream here.
notes
Valid values are json , opentelemetry1.0 and opentelemetry0.7 For more information about metric stream output formats, see Metric streams output formats .
This parameter is required.
roleArnstring | IRoleRefrole_arntyping.Union[str, IRoleRef]roleArnStringRoleArnstringRoleArninterface{}required#This IAM role must already exist and must be in the same account as the metric stream. This IAM role must include the firehose:PutRecord and firehose:PutRecordBatch permissions.
statisticsConfigurationsoptionalIResolvable | IResolvable | CfnMetricStream.MetricStreamStatisticsConfigurationProperty[]statistics_configurationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, MetricStreamStatisticsConfigurationProperty]]]statisticsConfigurationsoptionalIResolvableStatisticsConfigurationsoptionalIResolvableStatisticsConfigurationsoptionalinterface{}#notes
You can use this parameter to have the metric stream also send additional statistics in the stream. This array can have up to 100 members.
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 OutputFormat . 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 OpenTelemetry, you can stream percentile statistics.