Class: AWSCDK::CloudWatch::DashboardProps

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

Overview

Properties for defining a CloudWatch Dashboard.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dashboard_name: nil, default_interval: nil, _end: nil, period_override: nil, start: nil, variables: nil, widgets: nil) ⇒ DashboardProps

Returns a new instance of DashboardProps.

Parameters:

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

    Name of the dashboard.

  • default_interval (AWSCDK::Duration, nil) (defaults to: nil)

    Interval duration for metrics. You can specify defaultInterval with the relative time (e.g. cdk.Duration.days(7)).

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

    The end of the time range to use for each widget on the dashboard when the dashboard loads.

  • period_override (AWSCDK::CloudWatch::PeriodOverride, nil) (defaults to: nil)

    Use this field to specify the period for the graphs when the dashboard loads.

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

    The start of the time range to use for each widget on the dashboard.

  • variables (Array<AWSCDK::CloudWatch::IVariable>, nil) (defaults to: nil)

    A list of dashboard variables.

  • widgets (Array<Array<AWSCDK::CloudWatch::IWidget>>, nil) (defaults to: nil)

    Initial set of widgets on the dashboard.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'cloud_watch/dashboard_props.rb', line 14

def initialize(dashboard_name: nil, default_interval: nil, _end: nil, period_override: nil, start: nil, variables: nil, widgets: nil)
  @dashboard_name = dashboard_name
  Jsii::Type.check_type(@dashboard_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dashboardName") unless @dashboard_name.nil?
  @default_interval = default_interval
  Jsii::Type.check_type(@default_interval, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "defaultInterval") unless @default_interval.nil?
  @_end = _end
  Jsii::Type.check_type(@_end, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "end") unless @_end.nil?
  @period_override = period_override
  Jsii::Type.check_type(@period_override, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5QZXJpb2RPdmVycmlkZSJ9")), "periodOverride") unless @period_override.nil?
  @start = start
  Jsii::Type.check_type(@start, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "start") unless @start.nil?
  @variables = variables
  Jsii::Type.check_type(@variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jbG91ZHdhdGNoLklWYXJpYWJsZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "variables") unless @variables.nil?
  @widgets = widgets
  Jsii::Type.check_type(@widgets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsiZnFuIjoiYXdzLWNkay1saWIuYXdzX2Nsb3Vkd2F0Y2guSVdpZGdldCJ9LCJraW5kIjoiYXJyYXkifX0sImtpbmQiOiJhcnJheSJ9fQ==")), "widgets") unless @widgets.nil?
end

Instance Attribute Details

#_endString? (readonly)

Note:

Default: When the dashboard loads, the end date will be the current time.

The end of the time range to use for each widget on the dashboard when the dashboard loads.

If you specify a value for end, you must also specify a value for start. Specify an absolute time in the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.

Returns:

  • (String, nil)


52
53
54
# File 'cloud_watch/dashboard_props.rb', line 52

def _end
  @_end
end

#dashboard_nameString? (readonly)

Note:

Default: - automatically generated name

Name of the dashboard.

If set, must only contain alphanumerics, dash (-) and underscore (_)

Returns:

  • (String, nil)


37
38
39
# File 'cloud_watch/dashboard_props.rb', line 37

def dashboard_name
  @dashboard_name
end

#default_intervalAWSCDK::Duration? (readonly)

Note:

Default: When the dashboard loads, the defaultInterval time will be the default time range.

Interval duration for metrics. You can specify defaultInterval with the relative time (e.g. cdk.Duration.days(7)).

Both properties default_interval and start cannot be set at once.

Returns:



44
45
46
# File 'cloud_watch/dashboard_props.rb', line 44

def default_interval
  @default_interval
end

#period_overrideAWSCDK::CloudWatch::PeriodOverride? (readonly)

Note:

Default: Auto

Use this field to specify the period for the graphs when the dashboard loads.

Specifying Auto causes the period of all graphs on the dashboard to automatically adapt to the time range of the dashboard. Specifying Inherit ensures that the period set for each graph is always obeyed.



60
61
62
# File 'cloud_watch/dashboard_props.rb', line 60

def period_override
  @period_override
end

#startString? (readonly)

Note:

Default: When the dashboard loads, the start time will be the default time range.

The start of the time range to use for each widget on the dashboard.

You can specify start without specifying end to specify a relative time range that ends with the current time. In this case, the value of start must begin with -P, and you can use M, H, D, W and M as abbreviations for minutes, hours, days, weeks and months. For example, -PT8H shows the last 8 hours and -P3M shows the last three months. You can also use start along with an end field, to specify an absolute time range. When specifying an absolute time range, use the ISO 8601 format. For example, 2018-12-17T06:00:00.000Z.

Both properties default_interval and start cannot be set at once.

Returns:

  • (String, nil)


73
74
75
# File 'cloud_watch/dashboard_props.rb', line 73

def start
  @start
end

#variablesArray<AWSCDK::CloudWatch::IVariable>? (readonly)

Note:

Default: - No variables

A list of dashboard variables.



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

def variables
  @variables
end

#widgetsArray<Array<AWSCDK::CloudWatch::IWidget>>? (readonly)

Note:

Default: - No widgets

Initial set of widgets on the dashboard.

One array represents a row of widgets.

Returns:



86
87
88
# File 'cloud_watch/dashboard_props.rb', line 86

def widgets
  @widgets
end

Class Method Details

.jsii_propertiesObject



88
89
90
91
92
93
94
95
96
97
98
# File 'cloud_watch/dashboard_props.rb', line 88

def self.jsii_properties
  {
    :dashboard_name => "dashboardName",
    :default_interval => "defaultInterval",
    :_end => "end",
    :period_override => "periodOverride",
    :start => "start",
    :variables => "variables",
    :widgets => "widgets",
  }
end

Instance Method Details

#to_jsiiObject



100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'cloud_watch/dashboard_props.rb', line 100

def to_jsii
  result = {}
  result.merge!({
    "dashboardName" => @dashboard_name,
    "defaultInterval" => @default_interval,
    "end" => @_end,
    "periodOverride" => @period_override,
    "start" => @start,
    "variables" => @variables,
    "widgets" => @widgets,
  })
  result.compact
end