Class: AWSCDK::IoT::CfnTopicRule::CloudwatchMetricActionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t/cfn_topic_rule.rb

Overview

Describes an action that captures a CloudWatch metric.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric_name:, metric_namespace:, metric_unit:, metric_value:, role_arn:, metric_timestamp: nil) ⇒ CloudwatchMetricActionProperty

Returns a new instance of CloudwatchMetricActionProperty.

Parameters:

  • metric_name (String)

    The CloudWatch metric name.

  • metric_namespace (String)

    The CloudWatch metric namespace name.

  • metric_unit (String)

    The metric unit supported by CloudWatch.

  • metric_value (String)

    The CloudWatch metric value.

  • role_arn (String)

    The IAM role that allows access to the CloudWatch metric.

  • metric_timestamp (String, nil) (defaults to: nil)

    An optional Unix timestamp .



1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
# File 'io_t/cfn_topic_rule.rb', line 1168

def initialize(metric_name:, metric_namespace:, metric_unit:, metric_value:, role_arn:, metric_timestamp: nil)
  @metric_name = metric_name
  Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  @metric_namespace = metric_namespace
  Jsii::Type.check_type(@metric_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricNamespace")
  @metric_unit = metric_unit
  Jsii::Type.check_type(@metric_unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricUnit")
  @metric_value = metric_value
  Jsii::Type.check_type(@metric_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricValue")
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn")
  @metric_timestamp = metric_timestamp
  Jsii::Type.check_type(@metric_timestamp, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricTimestamp") unless @metric_timestamp.nil?
end

Instance Attribute Details

#metric_nameString (readonly)

The CloudWatch metric name.



1187
1188
1189
# File 'io_t/cfn_topic_rule.rb', line 1187

def metric_name
  @metric_name
end

#metric_namespaceString (readonly)

The CloudWatch metric namespace name.



1192
1193
1194
# File 'io_t/cfn_topic_rule.rb', line 1192

def metric_namespace
  @metric_namespace
end

#metric_timestampString? (readonly)

An optional Unix timestamp .



1212
1213
1214
# File 'io_t/cfn_topic_rule.rb', line 1212

def metric_timestamp
  @metric_timestamp
end

#metric_unitString (readonly)

The metric unit supported by CloudWatch.



1197
1198
1199
# File 'io_t/cfn_topic_rule.rb', line 1197

def metric_unit
  @metric_unit
end

#metric_valueString (readonly)

The CloudWatch metric value.



1202
1203
1204
# File 'io_t/cfn_topic_rule.rb', line 1202

def metric_value
  @metric_value
end

#role_arnString (readonly)

The IAM role that allows access to the CloudWatch metric.



1207
1208
1209
# File 'io_t/cfn_topic_rule.rb', line 1207

def role_arn
  @role_arn
end

Class Method Details

.jsii_propertiesObject



1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
# File 'io_t/cfn_topic_rule.rb', line 1214

def self.jsii_properties
  {
    :metric_name => "metricName",
    :metric_namespace => "metricNamespace",
    :metric_unit => "metricUnit",
    :metric_value => "metricValue",
    :role_arn => "roleArn",
    :metric_timestamp => "metricTimestamp",
  }
end

Instance Method Details

#to_jsiiObject



1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
# File 'io_t/cfn_topic_rule.rb', line 1225

def to_jsii
  result = {}
  result.merge!({
    "metricName" => @metric_name,
    "metricNamespace" => @metric_namespace,
    "metricUnit" => @metric_unit,
    "metricValue" => @metric_value,
    "roleArn" => @role_arn,
    "metricTimestamp" => @metric_timestamp,
  })
  result.compact
end