CfnMetricStreamPropsMixin

class aws_cdk.mixins_preview.aws_cloudwatch.mixins.CfnMetricStreamPropsMixin(props, *, strategy=None)

Bases: Mixin

Creates 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:PassRole permission and either the CloudWatchFullAccess policy or the cloudwatch:PutMetricStream permission.

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 running state. 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-metricstream.html

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:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

MetricStreamFilterProperty

class CfnMetricStreamPropsMixin.MetricStreamFilterProperty(*, metric_names=None, namespace=None)

Bases: object

This 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamfilter.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamfilter.html#cfn-cloudwatch-metricstream-metricstreamfilter-metricnames

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamfilter.html#cfn-cloudwatch-metricstream-metricstreamfilter-namespace

MetricStreamStatisticsConfigurationProperty

class CfnMetricStreamPropsMixin.MetricStreamStatisticsConfigurationProperty(*, additional_statistics=None, include_metrics=None)

Bases: object

This 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 in IncludeMetrics .

  • 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration.html

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration.html#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-additionalstatistics

include_metrics

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsconfiguration.html#cfn-cloudwatch-metricstream-metricstreamstatisticsconfiguration-includemetrics

MetricStreamStatisticsMetricProperty

class CfnMetricStreamPropsMixin.MetricStreamStatisticsMetricProperty(*, metric_name=None, namespace=None)

Bases: object

A 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric.html#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-metricname

namespace

The namespace of the metric.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudwatch-metricstream-metricstreamstatisticsmetric.html#cfn-cloudwatch-metricstream-metricstreamstatisticsmetric-namespace