Class: AWSCDK::GuardDuty::CfnFilterProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
guard_duty/cfn_filter_props.rb

Overview

Properties for defining a CfnFilter.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(detector_id:, finding_criteria:, name:, action: nil, description: nil, rank: nil, tags: nil) ⇒ CfnFilterProps

Returns a new instance of CfnFilterProps.

Parameters:

  • detector_id (String)

    The detector ID associated with the GuardDuty account for which you want to create a filter.

  • finding_criteria (AWSCDK::IResolvable, AWSCDK::GuardDuty::CfnFilter::FindingCriteriaProperty)

    Represents the criteria to be used in the filter for querying findings.

  • name (String)

    The name of the filter.

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

    Specifies the action that is to be applied to the findings that match the filter.

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

    The description of the filter.

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

    Specifies the position of the filter in the list of current filters.

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

    The tags to be added to a new filter resource.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'guard_duty/cfn_filter_props.rb', line 16

def initialize(detector_id:, finding_criteria:, name:, action: nil, description: nil, rank: nil, tags: nil)
  @detector_id = detector_id
  Jsii::Type.check_type(@detector_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "detectorId")
  @finding_criteria = finding_criteria.is_a?(Hash) ? ::AWSCDK::GuardDuty::CfnFilter::FindingCriteriaProperty.new(**finding_criteria.transform_keys(&:to_sym)) : finding_criteria
  Jsii::Type.check_type(@finding_criteria, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ndWFyZGR1dHkuQ2ZuRmlsdGVyLkZpbmRpbmdDcml0ZXJpYVByb3BlcnR5In1dfX0=")), "findingCriteria")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action") unless @action.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @rank = rank
  Jsii::Type.check_type(@rank, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "rank") unless @rank.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

#actionString? (readonly)

Specifies the action that is to be applied to the findings that match the filter.



57
58
59
# File 'guard_duty/cfn_filter_props.rb', line 57

def action
  @action
end

#descriptionString? (readonly)

The description of the filter.

Valid characters include alphanumeric characters, and special characters such as hyphen, period, colon, underscore, parentheses ( { } , [ ] , and ( ) ), forward slash, horizontal tab, vertical tab, newline, form feed, return, and whitespace.



64
65
66
# File 'guard_duty/cfn_filter_props.rb', line 64

def description
  @description
end

#detector_idString (readonly)

The detector ID associated with the GuardDuty account for which you want to create a filter.

To find the detector_id in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.



40
41
42
# File 'guard_duty/cfn_filter_props.rb', line 40

def detector_id
  @detector_id
end

#finding_criteriaAWSCDK::IResolvable, AWSCDK::GuardDuty::CfnFilter::FindingCriteriaProperty (readonly)

Represents the criteria to be used in the filter for querying findings.



45
46
47
# File 'guard_duty/cfn_filter_props.rb', line 45

def finding_criteria
  @finding_criteria
end

#nameString (readonly)

The name of the filter.

Valid characters include period (.), underscore (_), dash (-), and alphanumeric characters. A whitespace is considered to be an invalid character.



52
53
54
# File 'guard_duty/cfn_filter_props.rb', line 52

def name
  @name
end

#rankNumeric? (readonly)

Specifies the position of the filter in the list of current filters.

Also specifies the order in which this filter is applied to the findings. The minimum value for this property is 1 and the maximum is 100.

By default, filters may not be created in the same order as they are ranked. To ensure that the filters are created in the expected order, you can use an optional attribute, DependsOn , with the following syntax: "DependsOn":[ "ObjectName" ] .



73
74
75
# File 'guard_duty/cfn_filter_props.rb', line 73

def rank
  @rank
end

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

The tags to be added to a new filter resource.

Each tag consists of a key and an optional value, both of which you define.

For more information, see Tag .



82
83
84
# File 'guard_duty/cfn_filter_props.rb', line 82

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



84
85
86
87
88
89
90
91
92
93
94
# File 'guard_duty/cfn_filter_props.rb', line 84

def self.jsii_properties
  {
    :detector_id => "detectorId",
    :finding_criteria => "findingCriteria",
    :name => "name",
    :action => "action",
    :description => "description",
    :rank => "rank",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'guard_duty/cfn_filter_props.rb', line 96

def to_jsii
  result = {}
  result.merge!({
    "detectorId" => @detector_id,
    "findingCriteria" => @finding_criteria,
    "name" => @name,
    "action" => @action,
    "description" => @description,
    "rank" => @rank,
    "tags" => @tags,
  })
  result.compact
end