Class: AWSCDK::CloudWatch::CfnMetricStreamProps

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

Overview

Properties for defining a CfnMetricStream.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(firehose_arn:, output_format:, role_arn:, exclude_filters: nil, include_filters: nil, include_linked_accounts_metrics: nil, name: nil, statistics_configurations: nil, tags: nil) ⇒ CfnMetricStreamProps

Returns a new instance of CfnMetricStreamProps.

Parameters:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'cloud_watch/cfn_metric_stream_props.rb', line 18

def initialize(firehose_arn:, output_format:, role_arn:, exclude_filters: nil, include_filters: nil, include_linked_accounts_metrics: nil, name: nil, statistics_configurations: nil, tags: nil)
  @firehose_arn = firehose_arn
  Jsii::Type.check_type(@firehose_arn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19raW5lc2lzZmlyZWhvc2UuSURlbGl2ZXJ5U3RyZWFtUmVmIn1dfX0=")), "firehoseArn")
  @output_format = output_format
  Jsii::Type.check_type(@output_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "outputFormat")
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19pYW0uSVJvbGVSZWYifV19fQ==")), "roleArn")
  @exclude_filters = exclude_filters
  Jsii::Type.check_type(@exclude_filters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5DZm5NZXRyaWNTdHJlYW0uTWV0cmljU3RyZWFtRmlsdGVyUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "excludeFilters") unless @exclude_filters.nil?
  @include_filters = include_filters
  Jsii::Type.check_type(@include_filters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5DZm5NZXRyaWNTdHJlYW0uTWV0cmljU3RyZWFtRmlsdGVyUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "includeFilters") unless @include_filters.nil?
  @include_linked_accounts_metrics = include_linked_accounts_metrics
  Jsii::Type.check_type(@include_linked_accounts_metrics, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "includeLinkedAccountsMetrics") unless @include_linked_accounts_metrics.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @statistics_configurations = statistics_configurations
  Jsii::Type.check_type(@statistics_configurations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5DZm5NZXRyaWNTdHJlYW0uTWV0cmljU3RyZWFtU3RhdGlzdGljc0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "statisticsConfigurations") unless @statistics_configurations.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#exclude_filtersAWSCDK::IResolvable, ... (readonly)

If you specify this parameter, the stream sends metrics from all metric namespaces except for the namespaces that you specify here.

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.



70
71
72
# File 'cloud_watch/cfn_metric_stream_props.rb', line 70

def exclude_filters
  @exclude_filters
end

#firehose_arnString, AWSCDK::Interfaces::AWSKinesisfirehose::IDeliveryStreamRef (readonly)

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

This Amazon Kinesis Firehose delivery stream must already exist and must be in the same account as the metric stream.



45
46
47
# File 'cloud_watch/cfn_metric_stream_props.rb', line 45

def firehose_arn
  @firehose_arn
end

#include_filtersAWSCDK::IResolvable, ... (readonly)

If you specify this parameter, the stream sends only the metrics from the metric namespaces that you specify here.

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.



79
80
81
# File 'cloud_watch/cfn_metric_stream_props.rb', line 79

def include_filters
  @include_filters
end

#include_linked_accounts_metricsBoolean, ... (readonly)

If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring account, in the metric stream.

The default is false .

For more information about linking accounts, see CloudWatch cross-account observability



88
89
90
# File 'cloud_watch/cfn_metric_stream_props.rb', line 88

def include_linked_accounts_metrics
  @include_linked_accounts_metrics
end

#nameString? (readonly)

If you are creating a new metric stream, this is the name for the new stream.

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.



97
98
99
# File 'cloud_watch/cfn_metric_stream_props.rb', line 97

def name
  @name
end

#output_formatString (readonly)

The output format for the stream.

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.



54
55
56
# File 'cloud_watch/cfn_metric_stream_props.rb', line 54

def output_format
  @output_format
end

#role_arnString, AWSCDK::Interfaces::AWSIAM::IRoleRef (readonly)

The ARN of an IAM role that this metric stream will use to access Amazon Kinesis Firehose resources.

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.



61
62
63
# File 'cloud_watch/cfn_metric_stream_props.rb', line 61

def role_arn
  @role_arn
end

#statistics_configurationsAWSCDK::IResolvable, ... (readonly)

By default, a metric stream always sends the MAX, MIN, SUM, and SAMPLECOUNT statistics for each metric that is streamed.

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.



106
107
108
# File 'cloud_watch/cfn_metric_stream_props.rb', line 106

def statistics_configurations
  @statistics_configurations
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An array of key-value pairs to apply to the metric stream.

For more information, see Tag .



113
114
115
# File 'cloud_watch/cfn_metric_stream_props.rb', line 113

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'cloud_watch/cfn_metric_stream_props.rb', line 115

def self.jsii_properties
  {
    :firehose_arn => "firehoseArn",
    :output_format => "outputFormat",
    :role_arn => "roleArn",
    :exclude_filters => "excludeFilters",
    :include_filters => "includeFilters",
    :include_linked_accounts_metrics => "includeLinkedAccountsMetrics",
    :name => "name",
    :statistics_configurations => "statisticsConfigurations",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'cloud_watch/cfn_metric_stream_props.rb', line 129

def to_jsii
  result = {}
  result.merge!({
    "firehoseArn" => @firehose_arn,
    "outputFormat" => @output_format,
    "roleArn" => @role_arn,
    "excludeFilters" => @exclude_filters,
    "includeFilters" => @include_filters,
    "includeLinkedAccountsMetrics" => @include_linked_accounts_metrics,
    "name" => @name,
    "statisticsConfigurations" => @statistics_configurations,
    "tags" => @tags,
  })
  result.compact
end