CfnMetricStreamPropsMixin
- class aws_cdk.mixins_preview.aws_cloudwatch.mixins.CfnMetricStreamPropsMixin(props, *, strategy=None)
Bases:
MixinCreates or updates a metric stream.
Metrics streams can automatically stream CloudWatch metrics to AWS destinations including Amazon S3 and to many third-party solutions. For more information, see Metric streams .
To create a metric stream, you must be logged on to an account that has the
iam:PassRolepermission and either the CloudWatchFullAccess policy or thecloudwatch:PutMetricStreampermission.When you create or update a metric stream, you choose one of the following:
Stream metrics from all metric namespaces in the account.
Stream metrics from all metric namespaces in the account, except for the namespaces that you list in
ExcludeFilters.Stream metrics from only the metric namespaces that you list in
IncludeFilters.
When you create a metric stream, the stream is created in the
runningstate. If you update an existing metric stream, the state does not change.If you create a metric stream in an account that has been set up as a monitoring account in CloudWatch cross-account observability, you can choose whether to include metrics from linked source accounts in the metric stream.
- See:
- CloudformationResource:
AWS::CloudWatch::MetricStream
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_cloudwatch import mixins as cloudwatch_mixins cfn_metric_stream_props_mixin = cloudwatch_mixins.CfnMetricStreamPropsMixin(cloudwatch_mixins.CfnMetricStreamMixinProps( exclude_filters=[cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamFilterProperty( metric_names=["metricNames"], namespace="namespace" )], firehose_arn="firehoseArn", include_filters=[cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamFilterProperty( metric_names=["metricNames"], namespace="namespace" )], include_linked_accounts_metrics=False, name="name", output_format="outputFormat", role_arn="roleArn", statistics_configurations=[cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamStatisticsConfigurationProperty( additional_statistics=["additionalStatistics"], include_metrics=[cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamStatisticsMetricProperty( metric_name="metricName", namespace="namespace" )] )], tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::CloudWatch::MetricStream.- Parameters:
props (
Union[CfnMetricStreamMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['excludeFilters', 'firehoseArn', 'includeFilters', 'includeLinkedAccountsMetrics', 'name', 'outputFormat', 'roleArn', 'statisticsConfigurations', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
MetricStreamFilterProperty
- class CfnMetricStreamPropsMixin.MetricStreamFilterProperty(*, metric_names=None, namespace=None)
Bases:
objectThis structure contains a metric namespace and optionally, a list of metric names, to either include in a metric ‘ stream or exclude from a metric stream.
A metric stream’s filters can include up to 1000 total names. This limit applies to the sum of namespace names and metric names in the filters. For example, this could include 10 metric namespace filters with 99 metrics each, or 20 namespace filters with 49 metrics specified in each filter.
- Parameters:
metric_names (
Optional[Sequence[str]]) – The names of the metrics to either include or exclude from the metric stream. If you omit this parameter, all metrics in the namespace are included or excluded, depending on whether this filter is specified as an exclude filter or an include filter. Each metric name can contain only ASCII printable characters (ASCII range 32 through 126). Each metric name must contain at least one non-whitespace character.namespace (
Optional[str]) – The name of the metric namespace in the filter. The namespace can contain only ASCII printable characters (ASCII range 32 through 126). It must contain at least one non-whitespace character.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cloudwatch import mixins as cloudwatch_mixins metric_stream_filter_property = cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamFilterProperty( metric_names=["metricNames"], namespace="namespace" )
Attributes
- metric_names
The names of the metrics to either include or exclude from the metric stream.
If you omit this parameter, all metrics in the namespace are included or excluded, depending on whether this filter is specified as an exclude filter or an include filter.
Each metric name can contain only ASCII printable characters (ASCII range 32 through 126). Each metric name must contain at least one non-whitespace character.
- namespace
The name of the metric namespace in the filter.
The namespace can contain only ASCII printable characters (ASCII range 32 through 126). It must contain at least one non-whitespace character.
MetricStreamStatisticsConfigurationProperty
- class CfnMetricStreamPropsMixin.MetricStreamStatisticsConfigurationProperty(*, additional_statistics=None, include_metrics=None)
Bases:
objectThis structure specifies a list of additional statistics to stream, and the metrics to stream those additional statistics for.
All metrics that match the combination of metric name and namespace will be streamed with the additional statistics, no matter their dimensions.
- Parameters:
additional_statistics (
Optional[Sequence[str]]) – The additional statistics to stream for the metrics listed inIncludeMetrics.include_metrics (
Union[IResolvable,Sequence[Union[IResolvable,MetricStreamStatisticsMetricProperty,Dict[str,Any]]],None]) – An array that defines the metrics that are to have additional statistics streamed.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cloudwatch import mixins as cloudwatch_mixins metric_stream_statistics_configuration_property = cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamStatisticsConfigurationProperty( additional_statistics=["additionalStatistics"], include_metrics=[cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamStatisticsMetricProperty( metric_name="metricName", namespace="namespace" )] )
Attributes
- additional_statistics
The additional statistics to stream for the metrics listed in
IncludeMetrics.
- include_metrics
An array that defines the metrics that are to have additional statistics streamed.
MetricStreamStatisticsMetricProperty
- class CfnMetricStreamPropsMixin.MetricStreamStatisticsMetricProperty(*, metric_name=None, namespace=None)
Bases:
objectA structure that specifies the metric name and namespace for one metric that is going to have additional statistics included in the stream.
- Parameters:
metric_name (
Optional[str]) – The name of the metric.namespace (
Optional[str]) – The namespace of the metric.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_cloudwatch import mixins as cloudwatch_mixins metric_stream_statistics_metric_property = cloudwatch_mixins.CfnMetricStreamPropsMixin.MetricStreamStatisticsMetricProperty( metric_name="metricName", namespace="namespace" )
Attributes
- metric_name
The name of the metric.