Class: AWSCDK::CloudWatch::LogQueryWidgetProps

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

Overview

Properties for a Query widget.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_group_names:, account_id: nil, height: nil, query_language: nil, query_lines: nil, query_string: nil, region: nil, title: nil, view: nil, width: nil) ⇒ LogQueryWidgetProps

Returns a new instance of LogQueryWidgetProps.

Parameters:

  • log_group_names (Array<String>)

    Names of log groups to query.

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

    The AWS account ID where the log groups are located.

  • height (Numeric, nil) (defaults to: nil)

    Height of the widget.

  • query_language (AWSCDK::CloudWatch::LogQueryLanguage, nil) (defaults to: nil)

    The query language to use for the query.

  • query_lines (Array<String>, nil) (defaults to: nil)

    A sequence of lines to use to build the query.

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

    Full query string for log insights.

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

    The region the metrics of this widget should be taken from.

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

    Title for the widget.

  • view (AWSCDK::CloudWatch::LogQueryVisualizationType, nil) (defaults to: nil)

    The type of view to use.

  • width (Numeric, nil) (defaults to: nil)

    Width of the widget, in a grid of 24 units wide.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'cloud_watch/log_query_widget_props.rb', line 17

def initialize(log_group_names:, account_id: nil, height: nil, query_language: nil, query_lines: nil, query_string: nil, region: nil, title: nil, view: nil, width: nil)
  @log_group_names = log_group_names
  Jsii::Type.check_type(@log_group_names, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "logGroupNames")
  @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?
  @query_language = query_language
  Jsii::Type.check_type(@query_language, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Mb2dRdWVyeUxhbmd1YWdlIn0=")), "queryLanguage") unless @query_language.nil?
  @query_lines = query_lines
  Jsii::Type.check_type(@query_lines, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "queryLines") unless @query_lines.nil?
  @query_string = query_string
  Jsii::Type.check_type(@query_string, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "queryString") unless @query_string.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?
  @view = view
  Jsii::Type.check_type(@view, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Mb2dRdWVyeVZpc3VhbGl6YXRpb25UeXBlIn0=")), "view") unless @view.nil?
  @width = width
  Jsii::Type.check_type(@width, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "width") unless @width.nil?
end

Instance Attribute Details

#account_idString? (readonly)

Note:

Default: - Current account

The AWS account ID where the log groups 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

Returns:

  • (String, nil)


55
56
57
# File 'cloud_watch/log_query_widget_props.rb', line 55

def 
  @account_id
end

#heightNumeric? (readonly)

Note:

Default: 6

Height of the widget.

Returns:

  • (Numeric, nil)


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

def height
  @height
end

#log_group_namesArray<String> (readonly)

Names of log groups to query.

Returns:

  • (Array<String>)


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

def log_group_names
  @log_group_names
end

#query_languageAWSCDK::CloudWatch::LogQueryLanguage? (readonly)

Note:

Default: LogQueryLanguage.LOGS_INSIGHTS

The query language to use for the query.



65
66
67
# File 'cloud_watch/log_query_widget_props.rb', line 65

def query_language
  @query_language
end

#query_linesArray<String>? (readonly)

Note:

Default: - Exactly one of queryString, queryLines is required.

A sequence of lines to use to build the query.

The query will be built by joining the lines together using \n|.

Returns:

  • (Array<String>, nil)


72
73
74
# File 'cloud_watch/log_query_widget_props.rb', line 72

def query_lines
  @query_lines
end

#query_stringString? (readonly)

Note:

Default: - Exactly one of queryString, queryLines is required.

Full query string for log insights.

Be sure to prepend every new line with a newline and pipe character (\n|).

Returns:

  • (String, nil)


80
81
82
# File 'cloud_watch/log_query_widget_props.rb', line 80

def query_string
  @query_string
end

#regionString? (readonly)

Note:

Default: Current region

The region the metrics of this widget should be taken from.

Returns:

  • (String, nil)


85
86
87
# File 'cloud_watch/log_query_widget_props.rb', line 85

def region
  @region
end

#titleString? (readonly)

Note:

Default: No title

Title for the widget.

Returns:

  • (String, nil)


90
91
92
# File 'cloud_watch/log_query_widget_props.rb', line 90

def title
  @title
end

#viewAWSCDK::CloudWatch::LogQueryVisualizationType? (readonly)

Note:

Default: LogQueryVisualizationType.TABLE

The type of view to use.



95
96
97
# File 'cloud_watch/log_query_widget_props.rb', line 95

def view
  @view
end

#widthNumeric? (readonly)

Note:

Default: 6

Width of the widget, in a grid of 24 units wide.

Returns:

  • (Numeric, nil)


100
101
102
# File 'cloud_watch/log_query_widget_props.rb', line 100

def width
  @width
end

Class Method Details

.jsii_propertiesObject



102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'cloud_watch/log_query_widget_props.rb', line 102

def self.jsii_properties
  {
    :log_group_names => "logGroupNames",
    :account_id => "accountId",
    :height => "height",
    :query_language => "queryLanguage",
    :query_lines => "queryLines",
    :query_string => "queryString",
    :region => "region",
    :title => "title",
    :view => "view",
    :width => "width",
  }
end

Instance Method Details

#to_jsiiObject



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'cloud_watch/log_query_widget_props.rb', line 117

def to_jsii
  result = {}
  result.merge!({
    "logGroupNames" => @log_group_names,
    "accountId" => @account_id,
    "height" => @height,
    "queryLanguage" => @query_language,
    "queryLines" => @query_lines,
    "queryString" => @query_string,
    "region" => @region,
    "title" => @title,
    "view" => @view,
    "width" => @width,
  })
  result.compact
end