Class: AWSCDK::CloudWatch::CfnMetricStream::MetricStreamFilterProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_watch/cfn_metric_stream.rb

Overview

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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace:, metric_names: nil) ⇒ MetricStreamFilterProperty

Returns a new instance of MetricStreamFilterProperty.

Parameters:

  • namespace (String)

    The name of the metric namespace in the filter.

  • metric_names (Array<String>, nil) (defaults to: nil)

    The names of the metrics to either include or exclude from the metric stream.



688
689
690
691
692
693
# File 'cloud_watch/cfn_metric_stream.rb', line 688

def initialize(namespace:, metric_names: nil)
  @namespace = namespace
  Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace")
  @metric_names = metric_names
  Jsii::Type.check_type(@metric_names, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "metricNames") unless @metric_names.nil?
end

Instance Attribute Details

#metric_namesArray<String>? (readonly)

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.



710
711
712
# File 'cloud_watch/cfn_metric_stream.rb', line 710

def metric_names
  @metric_names
end

#namespaceString (readonly)

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.



701
702
703
# File 'cloud_watch/cfn_metric_stream.rb', line 701

def namespace
  @namespace
end

Class Method Details

.jsii_propertiesObject



712
713
714
715
716
717
# File 'cloud_watch/cfn_metric_stream.rb', line 712

def self.jsii_properties
  {
    :namespace => "namespace",
    :metric_names => "metricNames",
  }
end

Instance Method Details

#to_jsiiObject



719
720
721
722
723
724
725
726
# File 'cloud_watch/cfn_metric_stream.rb', line 719

def to_jsii
  result = {}
  result.merge!({
    "namespace" => @namespace,
    "metricNames" => @metric_names,
  })
  result.compact
end