Class: AWSCDK::CloudTrail::CfnTrail::InsightSelectorProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_trail/cfn_trail.rb

Overview

A JSON string that contains a list of Insights types that are logged on a trail.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_categories: nil, insight_type: nil) ⇒ InsightSelectorProperty

Returns a new instance of InsightSelectorProperty.

Parameters:

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

    Select the event category on which Insights should be enabled.

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

    The type of Insights events to log on a trail. ApiCallRateInsight and ApiErrorRateInsight are valid Insight types.



1214
1215
1216
1217
1218
1219
# File 'cloud_trail/cfn_trail.rb', line 1214

def initialize(event_categories: nil, insight_type: nil)
  @event_categories = event_categories
  Jsii::Type.check_type(@event_categories, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "eventCategories") unless @event_categories.nil?
  @insight_type = insight_type
  Jsii::Type.check_type(@insight_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "insightType") unless @insight_type.nil?
end

Instance Attribute Details

#event_categoriesArray<String>? (readonly)

Select the event category on which Insights should be enabled.

  • If EventCategories is not provided, the specified Insights types are enabled on management API calls by default.
  • If EventCategories is provided, the given event categories will overwrite the existing ones. For example, if a trail already has Insights enabled on management events, and then a PutInsightSelectors request is made with only data events specified in EventCategories, Insights on management events will be disabled.


1228
1229
1230
# File 'cloud_trail/cfn_trail.rb', line 1228

def event_categories
  @event_categories
end

#insight_typeString? (readonly)

The type of Insights events to log on a trail. ApiCallRateInsight and ApiErrorRateInsight are valid Insight types.

The ApiCallRateInsight Insights type analyzes write-only management API calls that are aggregated per minute against a baseline API call volume.

The ApiErrorRateInsight Insights type analyzes management API calls that result in error codes. The error is shown if the API call is unsuccessful.



1237
1238
1239
# File 'cloud_trail/cfn_trail.rb', line 1237

def insight_type
  @insight_type
end

Class Method Details

.jsii_propertiesObject



1239
1240
1241
1242
1243
1244
# File 'cloud_trail/cfn_trail.rb', line 1239

def self.jsii_properties
  {
    :event_categories => "eventCategories",
    :insight_type => "insightType",
  }
end

Instance Method Details

#to_jsiiObject



1246
1247
1248
1249
1250
1251
1252
1253
# File 'cloud_trail/cfn_trail.rb', line 1246

def to_jsii
  result = {}
  result.merge!({
    "eventCategories" => @event_categories,
    "insightType" => @insight_type,
  })
  result.compact
end