Class: Aws::CloudTrail::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CloudTrail::Client
- Includes:
- Aws::ClientStubs
- Defined in:
- lib/aws-sdk-cloudtrail/client.rb
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#add_tags(params = {}) ⇒ Struct
Adds one or more tags to a trail, up to a limit of 50.
-
#create_trail(params = {}) ⇒ Types::CreateTrailResponse
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
-
#delete_trail(params = {}) ⇒ Struct
Deletes a trail.
-
#describe_trails(params = {}) ⇒ Types::DescribeTrailsResponse
Retrieves settings for the trail associated with the current region for your account.
-
#get_event_selectors(params = {}) ⇒ Types::GetEventSelectorsResponse
Describes the settings for the event selectors that you configured for your trail.
-
#get_trail_status(params = {}) ⇒ Types::GetTrailStatusResponse
Returns a JSON-formatted list of information about the specified trail.
-
#list_public_keys(params = {}) ⇒ Types::ListPublicKeysResponse
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
-
#list_tags(params = {}) ⇒ Types::ListTagsResponse
Lists the tags for the trail in the current region.
-
#lookup_events(params = {}) ⇒ Types::LookupEventsResponse
Looks up [management events] captured by CloudTrail.
-
#put_event_selectors(params = {}) ⇒ Types::PutEventSelectorsResponse
Configures an event selector for your trail.
-
#remove_tags(params = {}) ⇒ Struct
Removes the specified tags from a trail.
-
#start_logging(params = {}) ⇒ Struct
Starts the recording of AWS API calls and log file delivery for a trail.
-
#stop_logging(params = {}) ⇒ Struct
Suspends the recording of AWS API calls and log file delivery for the specified trail.
-
#update_trail(params = {}) ⇒ Types::UpdateTrailResponse
Updates the settings that specify delivery of log files.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
185 186 187 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 185 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1204 1205 1206 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 1204 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1207 1208 1209 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 1207 def errors_module Errors end |
Instance Method Details
#add_tags(params = {}) ⇒ Struct
Adds one or more tags to a trail, up to a limit of 50. Tags must be unique per trail. Overwrites an existing tag’s value when a new value is specified for an existing tag key. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail that applies to all regions only from the region in which the trail was created (that is, from its home region).
225 226 227 228 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 225 def (params = {}, = {}) req = build_request(:add_tags, params) req.send_request() end |
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 1182 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-cloudtrail' context[:gem_version] = '1.6.0' Seahorse::Client::Request.new(handlers, context) end |
#create_trail(params = {}) ⇒ Types::CreateTrailResponse
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. A maximum of five trails can exist in a region, irrespective of the region in which they were created.
371 372 373 374 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 371 def create_trail(params = {}, = {}) req = build_request(:create_trail, params) req.send_request() end |
#delete_trail(params = {}) ⇒ Struct
Deletes a trail. This operation must be called from the region in which the trail was created. ‘DeleteTrail` cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
398 399 400 401 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 398 def delete_trail(params = {}, = {}) req = build_request(:delete_trail, params) req.send_request() end |
#describe_trails(params = {}) ⇒ Types::DescribeTrailsResponse
Retrieves settings for the trail associated with the current region for your account.
467 468 469 470 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 467 def describe_trails(params = {}, = {}) req = build_request(:describe_trails, params) req.send_request() end |
#get_event_selectors(params = {}) ⇒ Types::GetEventSelectorsResponse
Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:
-
If your event selector includes read-only events, write-only events, or all events. This applies to both management events and data events.
-
If your event selector includes management events.
-
If your event selector includes data events, the Amazon S3 objects or AWS Lambda functions that you are logging for data events.
For more information, see [Logging Data and Management Events for Trails ][1] in the *AWS CloudTrail User Guide*.
538 539 540 541 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 538 def get_event_selectors(params = {}, = {}) req = build_request(:get_event_selectors, params) req.send_request() end |
#get_trail_status(params = {}) ⇒ Types::GetTrailStatusResponse
Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
608 609 610 611 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 608 def get_trail_status(params = {}, = {}) req = build_request(:get_trail_status, params) req.send_request() end |
#list_public_keys(params = {}) ⇒ Types::ListPublicKeysResponse
Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.
<note markdown=“1”> CloudTrail uses different private/public key pairs per region. Each digest file is signed with a private key unique to its region. Therefore, when you validate a digest file from a particular region, you must look in the same region for its corresponding public key.
</note>
664 665 666 667 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 664 def list_public_keys(params = {}, = {}) req = build_request(:list_public_keys, params) req.send_request() end |
#list_tags(params = {}) ⇒ Types::ListTagsResponse
Lists the tags for the trail in the current region.
705 706 707 708 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 705 def (params = {}, = {}) req = build_request(:list_tags, params) req.send_request() end |
#lookup_events(params = {}) ⇒ Types::LookupEventsResponse
Looks up [management events] captured by CloudTrail. Events for a region can be looked up in that region during the last 90 days. Lookup supports the following attributes:
-
AWS access key
-
Event ID
-
Event name
-
Event source
-
Read only
-
Resource name
-
Resource type
-
User name
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to one per second per account. If this limit is exceeded, a throttling error occurs.
Events that occurred during the selected time range will not be available for lookup if CloudTrail logging was not enabled when the events occurred.
810 811 812 813 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 810 def lookup_events(params = {}, = {}) req = build_request(:lookup_events, params) req.send_request() end |
#put_event_selectors(params = {}) ⇒ Types::PutEventSelectorsResponse
Configures an event selector for your trail. 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 selectors in 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.
Example
-
You create an event selector for a trail and specify that you want write-only events.
-
The EC2 ‘GetConsoleOutput` and `RunInstances` API operations occur in your account.
-
CloudTrail evaluates whether the events match your event selectors.
-
The ‘RunInstances` is a write-only event and it matches your event selector. The trail logs the event.
-
The ‘GetConsoleOutput` is a read-only event but it doesn’t match your event selector. The trail doesn’t log the event.
The ‘PutEventSelectors` operation must be called from the region in which the trail was created; otherwise, an `InvalidHomeRegionException` is thrown.
You can configure up to five event selectors for each trail. For more information, see [Logging Data and Management Events for Trails ][1] and [Limits in AWS CloudTrail] in the *AWS CloudTrail User Guide*.
[1]: docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html [2]: docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html
918 919 920 921 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 918 def put_event_selectors(params = {}, = {}) req = build_request(:put_event_selectors, params) req.send_request() end |
#remove_tags(params = {}) ⇒ Struct
Removes the specified tags from a trail.
952 953 954 955 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 952 def (params = {}, = {}) req = build_request(:remove_tags, params) req.send_request() end |
#start_logging(params = {}) ⇒ Struct
Starts the recording of AWS API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
981 982 983 984 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 981 def start_logging(params = {}, = {}) req = build_request(:start_logging, params) req.send_request() end |
#stop_logging(params = {}) ⇒ Struct
Suspends the recording of AWS API calls and log file delivery for the specified trail. Under most circumstances, there is no need to use this action. You can update a trail without stopping it first. This action is the only way to stop recording. For a trail enabled in all regions, this operation must be called from the region in which the trail was created, or an ‘InvalidHomeRegionException` will occur. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail enabled in all regions.
1014 1015 1016 1017 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 1014 def stop_logging(params = {}, = {}) req = build_request(:stop_logging, params) req.send_request() end |
#update_trail(params = {}) ⇒ Types::UpdateTrailResponse
Updates the settings that specify delivery of log files. Changes to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. ‘UpdateTrail` must be called from the region in which the trail was created; otherwise, an `InvalidHomeRegionException` is thrown.
1173 1174 1175 1176 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 1173 def update_trail(params = {}, = {}) req = build_request(:update_trail, params) req.send_request() end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1197 1198 1199 |
# File 'lib/aws-sdk-cloudtrail/client.rb', line 1197 def waiter_names [] end |