Class: AWSCDK::CloudWatch::CfnInsightRuleProps

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

Overview

Properties for defining a CfnInsightRule.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule_body:, rule_name:, rule_state:, apply_on_transformed_logs: nil, tags: nil) ⇒ CfnInsightRuleProps

Returns a new instance of CfnInsightRuleProps.

Parameters:

  • rule_body (String)

    The definition of the rule, as a JSON object.

  • rule_name (String)

    The name of the rule.

  • rule_state (String)

    The current state of the rule.

  • apply_on_transformed_logs (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Determines whether the rules is evaluated on transformed versions of logs.

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

    A list of key-value pairs to associate with the Contributor Insights rule.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'cloud_watch/cfn_insight_rule_props.rb', line 14

def initialize(rule_body:, rule_name:, rule_state:, apply_on_transformed_logs: nil, tags: nil)
  @rule_body = rule_body
  Jsii::Type.check_type(@rule_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleBody")
  @rule_name = rule_name
  Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName")
  @rule_state = rule_state
  Jsii::Type.check_type(@rule_state, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleState")
  @apply_on_transformed_logs = apply_on_transformed_logs
  Jsii::Type.check_type(@apply_on_transformed_logs, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "applyOnTransformedLogs") unless @apply_on_transformed_logs.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

#apply_on_transformed_logsBoolean, ... (readonly)

Determines whether the rules is evaluated on transformed versions of logs.

Valid values are TRUE and FALSE .



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

def apply_on_transformed_logs
  @apply_on_transformed_logs
end

#rule_bodyString (readonly)

The definition of the rule, as a JSON object.

For details about the syntax, see Contributor Insights Rule Syntax in the Amazon CloudWatch User Guide .



33
34
35
# File 'cloud_watch/cfn_insight_rule_props.rb', line 33

def rule_body
  @rule_body
end

#rule_nameString (readonly)

The name of the rule.



38
39
40
# File 'cloud_watch/cfn_insight_rule_props.rb', line 38

def rule_name
  @rule_name
end

#rule_stateString (readonly)

The current state of the rule.

Valid values are ENABLED and DISABLED .



45
46
47
# File 'cloud_watch/cfn_insight_rule_props.rb', line 45

def rule_state
  @rule_state
end

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

A list of key-value pairs to associate with the Contributor Insights rule.

You can associate as many as 50 tags with a rule.

Tags can help you organize and categorize your resources. For more information, see Tagging Your Amazon CloudWatch Resources .

To be able to associate tags with a rule, you must have the cloudwatch:TagResource permission in addition to the cloudwatch:PutInsightRule permission.



63
64
65
# File 'cloud_watch/cfn_insight_rule_props.rb', line 63

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
# File 'cloud_watch/cfn_insight_rule_props.rb', line 65

def self.jsii_properties
  {
    :rule_body => "ruleBody",
    :rule_name => "ruleName",
    :rule_state => "ruleState",
    :apply_on_transformed_logs => "applyOnTransformedLogs",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



75
76
77
78
79
80
81
82
83
84
85
# File 'cloud_watch/cfn_insight_rule_props.rb', line 75

def to_jsii
  result = {}
  result.merge!({
    "ruleBody" => @rule_body,
    "ruleName" => @rule_name,
    "ruleState" => @rule_state,
    "applyOnTransformedLogs" => @apply_on_transformed_logs,
    "tags" => @tags,
  })
  result.compact
end