Class: AWSCDK::CloudWatch::CfnDashboardProps

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

Overview

Properties for defining a CfnDashboard.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dashboard_body:, dashboard_name: nil, tags: nil) ⇒ CfnDashboardProps

Returns a new instance of CfnDashboardProps.

Parameters:

  • dashboard_body (String)

    The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard.

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

    The name of the dashboard.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    A list of key-value pairs to associate with the cloudwatch dashboard.



12
13
14
15
16
17
18
19
# File 'cloud_watch/cfn_dashboard_props.rb', line 12

def initialize(dashboard_body:, dashboard_name: nil, tags: nil)
  @dashboard_body = dashboard_body
  Jsii::Type.check_type(@dashboard_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dashboardBody")
  @dashboard_name = dashboard_name
  Jsii::Type.check_type(@dashboard_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dashboardName") unless @dashboard_name.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

#dashboard_bodyString (readonly)

The detailed information about the dashboard in JSON format, including the widgets to include and their location on the dashboard.

This parameter is required.

For more information about the syntax, see Dashboard Body Structure and Syntax .



29
30
31
# File 'cloud_watch/cfn_dashboard_props.rb', line 29

def dashboard_body
  @dashboard_body
end

#dashboard_nameString? (readonly)

The name of the dashboard.

The name must be between 1 and 255 characters. If you do not specify a name, one will be generated automatically.



36
37
38
# File 'cloud_watch/cfn_dashboard_props.rb', line 36

def dashboard_name
  @dashboard_name
end

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

A list of key-value pairs to associate with the cloudwatch dashboard.

You can associate up to 50 tags with a dashboard



43
44
45
# File 'cloud_watch/cfn_dashboard_props.rb', line 43

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



45
46
47
48
49
50
51
# File 'cloud_watch/cfn_dashboard_props.rb', line 45

def self.jsii_properties
  {
    :dashboard_body => "dashboardBody",
    :dashboard_name => "dashboardName",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



53
54
55
56
57
58
59
60
61
# File 'cloud_watch/cfn_dashboard_props.rb', line 53

def to_jsii
  result = {}
  result.merge!({
    "dashboardBody" => @dashboard_body,
    "dashboardName" => @dashboard_name,
    "tags" => @tags,
  })
  result.compact
end