Class: AWSCDK::CloudWatch::MetricWidgetProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudWatch::MetricWidgetProps
- Defined in:
- cloud_watch/metric_widget_props.rb
Overview
Basic properties for widgets that display metrics.
Direct Known Subclasses
AlarmWidgetProps, GaugeWidgetProps, GraphWidgetProps, SingleValueWidgetProps, TableWidgetProps
Instance Attribute Summary collapse
-
#account_id ⇒ String?
readonly
The AWS account ID where the metrics are located.
-
#height ⇒ Numeric?
readonly
Height of the widget.
-
#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) ⇒ MetricWidgetProps
constructor
A new instance of MetricWidgetProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(account_id: nil, height: nil, region: nil, title: nil, width: nil) ⇒ MetricWidgetProps
Returns a new instance of MetricWidgetProps.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'cloud_watch/metric_widget_props.rb', line 12 def initialize(account_id: nil, height: nil, region: nil, title: nil, width: 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? 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
36 37 38 |
# File 'cloud_watch/metric_widget_props.rb', line 36 def account_id @account_id 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.
41 42 43 |
# File 'cloud_watch/metric_widget_props.rb', line 41 def height @height end |
#region ⇒ String? (readonly)
Default: - Current region
The region the metrics of this graph should be taken from.
46 47 48 |
# File 'cloud_watch/metric_widget_props.rb', line 46 def region @region end |
#title ⇒ String? (readonly)
Default: - None
Title for the graph.
51 52 53 |
# File 'cloud_watch/metric_widget_props.rb', line 51 def title @title end |
#width ⇒ Numeric? (readonly)
Default: 6
Width of the widget, in a grid of 24 units wide.
56 57 58 |
# File 'cloud_watch/metric_widget_props.rb', line 56 def width @width end |
Class Method Details
.jsii_properties ⇒ Object
58 59 60 61 62 63 64 65 66 |
# File 'cloud_watch/metric_widget_props.rb', line 58 def self.jsii_properties { :account_id => "accountId", :height => "height", :region => "region", :title => "title", :width => "width", } end |
Instance Method Details
#to_jsii ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'cloud_watch/metric_widget_props.rb', line 68 def to_jsii result = {} result.merge!({ "accountId" => @account_id, "height" => @height, "region" => @region, "title" => @title, "width" => @width, }) result.compact end |