Class: AWSCDK::CloudWatch::AlarmWidgetProps
- Inherits:
-
MetricWidgetProps
- Object
- MetricWidgetProps
- AWSCDK::CloudWatch::AlarmWidgetProps
- Defined in:
- cloud_watch/alarm_widget_props.rb
Overview
Properties for an AlarmWidget.
Instance Attribute Summary collapse
-
#account_id ⇒ String?
readonly
The AWS account ID where the metrics are located.
-
#alarm ⇒ AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef
readonly
The alarm to show.
-
#height ⇒ Numeric?
readonly
Height of the widget.
-
#left_y_axis ⇒ AWSCDK::CloudWatch::YAxisProps?
readonly
Left Y axis.
-
#region ⇒ String?
readonly
The region the metrics of this graph should be taken from.
-
#title ⇒ String?
readonly
Title for the graph.
-
#width ⇒ Numeric?
readonly
Width of the widget, in a grid of 24 units wide.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, alarm:, left_y_axis: nil) ⇒ AlarmWidgetProps
constructor
A new instance of AlarmWidgetProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, alarm:, left_y_axis: nil) ⇒ AlarmWidgetProps
Returns a new instance of AlarmWidgetProps.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'cloud_watch/alarm_widget_props.rb', line 14 def initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil, alarm:, left_y_axis: nil) @account_id = account_id Jsii::Type.check_type(@account_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "accountId") unless @account_id.nil? @height = height Jsii::Type.check_type(@height, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "height") unless @height.nil? @region = region Jsii::Type.check_type(@region, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "region") unless @region.nil? @title = title Jsii::Type.check_type(@title, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "title") unless @title.nil? @width = width Jsii::Type.check_type(@width, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "width") unless @width.nil? @alarm = alarm Jsii::Type.check_type(@alarm, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jbG91ZHdhdGNoLklBbGFybVJlZiJ9")), "alarm") @left_y_axis = left_y_axis.is_a?(Hash) ? ::AWSCDK::CloudWatch::YAxisProps.new(**left_y_axis.transform_keys(&:to_sym)) : left_y_axis Jsii::Type.check_type(@left_y_axis, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5ZQXhpc1Byb3BzIn0=")), "leftYAxis") unless @left_y_axis.nil? end |
Instance Attribute Details
#account_id ⇒ String? (readonly)
Default: - Current account
The AWS account ID where the metrics are located.
This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account.
For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html
42 43 44 |
# File 'cloud_watch/alarm_widget_props.rb', line 42 def account_id @account_id end |
#alarm ⇒ AWSCDK::Interfaces::AWSCloudwatch::IAlarmRef (readonly)
The alarm to show.
66 67 68 |
# File 'cloud_watch/alarm_widget_props.rb', line 66 def alarm @alarm end |
#height ⇒ Numeric? (readonly)
Default: - 6 for Alarm and Graph widgets. 3 for single value widgets where most recent value of a metric is displayed.
Height of the widget.
47 48 49 |
# File 'cloud_watch/alarm_widget_props.rb', line 47 def height @height end |
#left_y_axis ⇒ AWSCDK::CloudWatch::YAxisProps? (readonly)
Default: - No minimum or maximum values for the left Y-axis
Left Y axis.
71 72 73 |
# File 'cloud_watch/alarm_widget_props.rb', line 71 def left_y_axis @left_y_axis end |
#region ⇒ String? (readonly)
Default: - Current region
The region the metrics of this graph should be taken from.
52 53 54 |
# File 'cloud_watch/alarm_widget_props.rb', line 52 def region @region end |
#title ⇒ String? (readonly)
Default: - None
Title for the graph.
57 58 59 |
# File 'cloud_watch/alarm_widget_props.rb', line 57 def title @title end |
#width ⇒ Numeric? (readonly)
Default: 6
Width of the widget, in a grid of 24 units wide.
62 63 64 |
# File 'cloud_watch/alarm_widget_props.rb', line 62 def width @width end |
Class Method Details
.jsii_properties ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 |
# File 'cloud_watch/alarm_widget_props.rb', line 73 def self.jsii_properties { :account_id => "accountId", :height => "height", :region => "region", :title => "title", :width => "width", :alarm => "alarm", :left_y_axis => "leftYAxis", } end |
Instance Method Details
#to_jsii ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'cloud_watch/alarm_widget_props.rb', line 85 def to_jsii result = {} result.merge!(super) result.merge!({ "accountId" => @account_id, "height" => @height, "region" => @region, "title" => @title, "width" => @width, "alarm" => @alarm, "leftYAxis" => @left_y_axis, }) result.compact end |