Class: AWSCDK::CloudTrail::CfnTrail::EventSelectorProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudTrail::CfnTrail::EventSelectorProperty
- Defined in:
- cloud_trail/cfn_trail.rb
Overview
Use event selectors to further specify the management and data event settings for your trail.
By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.
You can configure up to five event selectors for a trail.
You cannot apply both event selectors and advanced event selectors to a trail.
Instance Attribute Summary collapse
-
#data_resources ⇒ AWSCDK::IResolvable, ...
readonly
CloudTrail supports data event logging for Amazon S3 objects in standard S3 buckets, AWS Lambda functions, and Amazon DynamoDB tables with basic event selectors.
-
#exclude_management_event_sources ⇒ Array<String>?
readonly
An optional list of service event sources from which you do not want management events to be logged on your trail.
-
#include_management_events ⇒ Boolean, ...
readonly
Specify if you want your event selector to include management events for your trail.
-
#read_write_type ⇒ String?
readonly
Specify if you want your trail to log read-only events, write-only events, or all.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data_resources: nil, exclude_management_event_sources: nil, include_management_events: nil, read_write_type: nil) ⇒ EventSelectorProperty
constructor
A new instance of EventSelectorProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(data_resources: nil, exclude_management_event_sources: nil, include_management_events: nil, read_write_type: nil) ⇒ EventSelectorProperty
Returns a new instance of EventSelectorProperty.
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 |
# File 'cloud_trail/cfn_trail.rb', line 1135 def initialize(data_resources: nil, exclude_management_event_sources: nil, include_management_events: nil, read_write_type: nil) @data_resources = data_resources Jsii::Type.check_type(@data_resources, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR0cmFpbC5DZm5UcmFpbC5EYXRhUmVzb3VyY2VQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "dataResources") unless @data_resources.nil? @exclude_management_event_sources = exclude_management_event_sources Jsii::Type.check_type(@exclude_management_event_sources, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "excludeManagementEventSources") unless @exclude_management_event_sources.nil? @include_management_events = include_management_events Jsii::Type.check_type(@include_management_events, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "includeManagementEvents") unless @include_management_events.nil? @read_write_type = read_write_type Jsii::Type.check_type(@read_write_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "readWriteType") unless @read_write_type.nil? end |
Instance Attribute Details
#data_resources ⇒ AWSCDK::IResolvable, ... (readonly)
CloudTrail supports data event logging for Amazon S3 objects in standard S3 buckets, AWS Lambda functions, and Amazon DynamoDB tables with basic event selectors.
You can specify up to 250 resources for an individual event selector, but the total number of data resources cannot exceed 250 across all event selectors in a trail. This limit does not apply if you configure resource logging for all data events.
For more information, see Data Events and Limits in AWS CloudTrail in the AWS CloudTrail User Guide .
To log data events for all other resource types including objects stored in directory buckets , you must use AdvancedEventSelectors . You must also use
AdvancedEventSelectorsif you want to filter on theevent_namefield.
1156 1157 1158 |
# File 'cloud_trail/cfn_trail.rb', line 1156 def data_resources @data_resources end |
#exclude_management_event_sources ⇒ Array<String>? (readonly)
An optional list of service event sources from which you do not want management events to be logged on your trail.
In this release, the list can be empty (disables the filter), or it can filter out AWS Key Management Service or Amazon RDS Data API events by containing kms.amazonaws.com or rdsdata.amazonaws.com . By default, ExcludeManagementEventSources is empty, and AWS and Amazon RDS Data API events are logged to your trail. You can exclude management event sources only in Regions that support the event source.
1163 1164 1165 |
# File 'cloud_trail/cfn_trail.rb', line 1163 def exclude_management_event_sources @exclude_management_event_sources end |
#include_management_events ⇒ Boolean, ... (readonly)
Specify if you want your event selector to include management events for your trail.
For more information, see Management Events in the AWS CloudTrail User Guide .
By default, the value is true .
The first copy of management events is free. You are charged for additional copies of management events that you are logging on any subsequent trail in the same Region. For more information about CloudTrail pricing, see AWS CloudTrail Pricing .
1174 1175 1176 |
# File 'cloud_trail/cfn_trail.rb', line 1174 def include_management_events @include_management_events end |
#read_write_type ⇒ String? (readonly)
Specify if you want your trail to log read-only events, write-only events, or all.
For example, the EC2 GetConsoleOutput is a read-only API operation and RunInstances is a write-only API operation.
By default, the value is All .
1183 1184 1185 |
# File 'cloud_trail/cfn_trail.rb', line 1183 def read_write_type @read_write_type end |
Class Method Details
.jsii_properties ⇒ Object
1185 1186 1187 1188 1189 1190 1191 1192 |
# File 'cloud_trail/cfn_trail.rb', line 1185 def self.jsii_properties { :data_resources => "dataResources", :exclude_management_event_sources => "excludeManagementEventSources", :include_management_events => "includeManagementEvents", :read_write_type => "readWriteType", } end |
Instance Method Details
#to_jsii ⇒ Object
1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 |
# File 'cloud_trail/cfn_trail.rb', line 1194 def to_jsii result = {} result.merge!({ "dataResources" => @data_resources, "excludeManagementEventSources" => @exclude_management_event_sources, "includeManagementEvents" => @include_management_events, "readWriteType" => @read_write_type, }) result.compact end |