@Generated(value="software.amazon.awssdk:codegen") public interface CloudTrailAsyncClient extends SdkClient, SdkAutoCloseable
builder()
method.
This is the CloudTrail API Reference. It provides descriptions of actions, data types, common parameters, and common errors for CloudTrail.
CloudTrail is a web service that records AWS API calls for your AWS account and delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time of the AWS API call, the source IP address, the request parameters, and the response elements returned by the service.
As an alternative to the API, you can use one of the AWS SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to AWSCloudTrail. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the Tools for Amazon Web Services page.
See the AWS CloudTrail User Guide for information about the data that is included with each AWS API call listed in the log files.
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
default CompletableFuture<AddTagsResponse> |
addTags(AddTagsRequest addTagsRequest)
Adds one or more tags to a trail, up to a limit of 50.
|
default CompletableFuture<AddTagsResponse> |
addTags(Consumer<AddTagsRequest.Builder> addTagsRequest)
Adds one or more tags to a trail, up to a limit of 50.
|
static CloudTrailAsyncClientBuilder |
builder()
Create a builder that can be used to configure and create a
CloudTrailAsyncClient . |
static CloudTrailAsyncClient |
create()
Create a
CloudTrailAsyncClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from
the DefaultCredentialsProvider . |
default CompletableFuture<CreateTrailResponse> |
createTrail(Consumer<CreateTrailRequest.Builder> createTrailRequest)
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
|
default CompletableFuture<CreateTrailResponse> |
createTrail(CreateTrailRequest createTrailRequest)
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
|
default CompletableFuture<DeleteTrailResponse> |
deleteTrail(Consumer<DeleteTrailRequest.Builder> deleteTrailRequest)
Deletes a trail.
|
default CompletableFuture<DeleteTrailResponse> |
deleteTrail(DeleteTrailRequest deleteTrailRequest)
Deletes a trail.
|
default CompletableFuture<DescribeTrailsResponse> |
describeTrails()
Retrieves settings for the trail associated with the current region for your account.
|
default CompletableFuture<DescribeTrailsResponse> |
describeTrails(Consumer<DescribeTrailsRequest.Builder> describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
|
default CompletableFuture<DescribeTrailsResponse> |
describeTrails(DescribeTrailsRequest describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
|
default CompletableFuture<GetEventSelectorsResponse> |
getEventSelectors(Consumer<GetEventSelectorsRequest.Builder> getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail.
|
default CompletableFuture<GetEventSelectorsResponse> |
getEventSelectors(GetEventSelectorsRequest getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail.
|
default CompletableFuture<GetTrailStatusResponse> |
getTrailStatus(Consumer<GetTrailStatusRequest.Builder> getTrailStatusRequest)
Returns a JSON-formatted list of information about the specified trail.
|
default CompletableFuture<GetTrailStatusResponse> |
getTrailStatus(GetTrailStatusRequest getTrailStatusRequest)
Returns a JSON-formatted list of information about the specified trail.
|
default CompletableFuture<ListPublicKeysResponse> |
listPublicKeys()
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
|
default CompletableFuture<ListPublicKeysResponse> |
listPublicKeys(Consumer<ListPublicKeysRequest.Builder> listPublicKeysRequest)
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
|
default CompletableFuture<ListPublicKeysResponse> |
listPublicKeys(ListPublicKeysRequest listPublicKeysRequest)
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
|
default CompletableFuture<ListTagsResponse> |
listTags(Consumer<ListTagsRequest.Builder> listTagsRequest)
Lists the tags for the trail in the current region.
|
default CompletableFuture<ListTagsResponse> |
listTags(ListTagsRequest listTagsRequest)
Lists the tags for the trail in the current region.
|
default CompletableFuture<LookupEventsResponse> |
lookupEvents()
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account.
|
default CompletableFuture<LookupEventsResponse> |
lookupEvents(Consumer<LookupEventsRequest.Builder> lookupEventsRequest)
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account.
|
default CompletableFuture<LookupEventsResponse> |
lookupEvents(LookupEventsRequest lookupEventsRequest)
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account.
|
default LookupEventsPublisher |
lookupEventsPaginator()
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account.
|
default LookupEventsPublisher |
lookupEventsPaginator(LookupEventsRequest lookupEventsRequest)
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account.
|
default CompletableFuture<PutEventSelectorsResponse> |
putEventSelectors(Consumer<PutEventSelectorsRequest.Builder> putEventSelectorsRequest)
Configures an event selector for your trail.
|
default CompletableFuture<PutEventSelectorsResponse> |
putEventSelectors(PutEventSelectorsRequest putEventSelectorsRequest)
Configures an event selector for your trail.
|
default CompletableFuture<RemoveTagsResponse> |
removeTags(Consumer<RemoveTagsRequest.Builder> removeTagsRequest)
Removes the specified tags from a trail.
|
default CompletableFuture<RemoveTagsResponse> |
removeTags(RemoveTagsRequest removeTagsRequest)
Removes the specified tags from a trail.
|
default CompletableFuture<StartLoggingResponse> |
startLogging(Consumer<StartLoggingRequest.Builder> startLoggingRequest)
Starts the recording of AWS API calls and log file delivery for a trail.
|
default CompletableFuture<StartLoggingResponse> |
startLogging(StartLoggingRequest startLoggingRequest)
Starts the recording of AWS API calls and log file delivery for a trail.
|
default CompletableFuture<StopLoggingResponse> |
stopLogging(Consumer<StopLoggingRequest.Builder> stopLoggingRequest)
Suspends the recording of AWS API calls and log file delivery for the specified trail.
|
default CompletableFuture<StopLoggingResponse> |
stopLogging(StopLoggingRequest stopLoggingRequest)
Suspends the recording of AWS API calls and log file delivery for the specified trail.
|
default CompletableFuture<UpdateTrailResponse> |
updateTrail(Consumer<UpdateTrailRequest.Builder> updateTrailRequest)
Updates the settings that specify delivery of log files.
|
default CompletableFuture<UpdateTrailResponse> |
updateTrail(UpdateTrailRequest updateTrailRequest)
Updates the settings that specify delivery of log files.
|
serviceName
close
static final String SERVICE_NAME
static CloudTrailAsyncClient create()
CloudTrailAsyncClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from
the DefaultCredentialsProvider
.static CloudTrailAsyncClientBuilder builder()
CloudTrailAsyncClient
.default CompletableFuture<AddTagsResponse> addTags(AddTagsRequest addTagsRequest)
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).
addTagsRequest
- Specifies the tags to add to a trail.
arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<AddTagsResponse> addTags(Consumer<AddTagsRequest.Builder> addTagsRequest)
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).
AddTagsRequest.Builder
avoiding the need to create
one manually via AddTagsRequest.builder()
addTagsRequest
- a Consumer
that will call methods on AddTagsRequest.Builder
.
arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<CreateTrailResponse> createTrail(CreateTrailRequest createTrailRequest)
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.
createTrailRequest
- Specifies the settings for each trail.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<CreateTrailResponse> createTrail(Consumer<CreateTrailRequest.Builder> createTrailRequest)
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.
CreateTrailRequest.Builder
avoiding the need to
create one manually via CreateTrailRequest.builder()
createTrailRequest
- a Consumer
that will call methods on CreateTrailRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<DeleteTrailResponse> deleteTrail(DeleteTrailRequest deleteTrailRequest)
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.
deleteTrailRequest
- The request that specifies the name of a trail to delete.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<DeleteTrailResponse> deleteTrail(Consumer<DeleteTrailRequest.Builder> deleteTrailRequest)
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.
DeleteTrailRequest.Builder
avoiding the need to
create one manually via DeleteTrailRequest.builder()
deleteTrailRequest
- a Consumer
that will call methods on DeleteTrailRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<DescribeTrailsResponse> describeTrails(DescribeTrailsRequest describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
describeTrailsRequest
- Returns information about the trail.default CompletableFuture<DescribeTrailsResponse> describeTrails()
Retrieves settings for the trail associated with the current region for your account.
default CompletableFuture<DescribeTrailsResponse> describeTrails(Consumer<DescribeTrailsRequest.Builder> describeTrailsRequest)
Retrieves settings for the trail associated with the current region for your account.
DescribeTrailsRequest.Builder
avoiding the need to
create one manually via DescribeTrailsRequest.builder()
describeTrailsRequest
- a Consumer
that will call methods on DescribeTrailsRequest.Builder
.default CompletableFuture<GetEventSelectorsResponse> getEventSelectors(GetEventSelectorsRequest getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:
The S3 objects that you are logging for data events.
If your event selector includes management events.
If your event selector includes read-only events, write-only events, or all.
For more information, see Logging Data and Management Events for Trails in the AWS CloudTrail User Guide.
getEventSelectorsRequest
- Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<GetEventSelectorsResponse> getEventSelectors(Consumer<GetEventSelectorsRequest.Builder> getEventSelectorsRequest)
Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:
The S3 objects that you are logging for data events.
If your event selector includes management events.
If your event selector includes read-only events, write-only events, or all.
For more information, see Logging Data and Management Events for Trails in the AWS CloudTrail User Guide.
GetEventSelectorsRequest.Builder
avoiding the need
to create one manually via GetEventSelectorsRequest.builder()
getEventSelectorsRequest
- a Consumer
that will call methods on GetEventSelectorsRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<GetTrailStatusResponse> getTrailStatus(GetTrailStatusRequest getTrailStatusRequest)
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.
getTrailStatusRequest
- The name of a trail about which you want the current status.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<GetTrailStatusResponse> getTrailStatus(Consumer<GetTrailStatusRequest.Builder> getTrailStatusRequest)
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.
GetTrailStatusRequest.Builder
avoiding the need to
create one manually via GetTrailStatusRequest.builder()
getTrailStatusRequest
- a Consumer
that will call methods on GetTrailStatusRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<ListPublicKeysResponse> listPublicKeys(ListPublicKeysRequest listPublicKeysRequest)
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.
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.
listPublicKeysRequest
- Requests the public keys for a specified time range.default CompletableFuture<ListPublicKeysResponse> listPublicKeys()
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.
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.
default CompletableFuture<ListPublicKeysResponse> listPublicKeys(Consumer<ListPublicKeysRequest.Builder> listPublicKeysRequest)
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.
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.
ListPublicKeysRequest.Builder
avoiding the need to
create one manually via ListPublicKeysRequest.builder()
listPublicKeysRequest
- a Consumer
that will call methods on ListPublicKeysRequest.Builder
.default CompletableFuture<ListTagsResponse> listTags(ListTagsRequest listTagsRequest)
Lists the tags for the trail in the current region.
listTagsRequest
- Specifies a list of trail tags to return.
arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<ListTagsResponse> listTags(Consumer<ListTagsRequest.Builder> listTagsRequest)
Lists the tags for the trail in the current region.
ListTagsRequest.Builder
avoiding the need to
create one manually via ListTagsRequest.builder()
listTagsRequest
- a Consumer
that will call methods on ListTagsRequest.Builder
.
arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<LookupEventsResponse> lookupEvents(LookupEventsRequest lookupEventsRequest)
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports the following attributes:
Event ID
Event name
Event source
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 10, 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.
lookupEventsRequest
- Contains a request for LookupEvents.default CompletableFuture<LookupEventsResponse> lookupEvents()
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports the following attributes:
Event ID
Event name
Event source
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 10, 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.
default CompletableFuture<LookupEventsResponse> lookupEvents(Consumer<LookupEventsRequest.Builder> lookupEventsRequest)
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports the following attributes:
Event ID
Event name
Event source
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 10, 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.
LookupEventsRequest.Builder
avoiding the need to
create one manually via LookupEventsRequest.builder()
lookupEventsRequest
- a Consumer
that will call methods on LookupEventsRequest.Builder
.default LookupEventsPublisher lookupEventsPaginator(LookupEventsRequest lookupEventsRequest)
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports the following attributes:
Event ID
Event name
Event source
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 10, 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.
This is a variant of lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the forEach helper method
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Note: If you prefer to have control on service calls, use the
lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation.
lookupEventsRequest
- Contains a request for LookupEvents.default LookupEventsPublisher lookupEventsPaginator()
Looks up API activity events captured by CloudTrail that create, update, or delete resources in your account. Events for a region can be looked up for the times in which you had CloudTrail turned on in that region during the last seven days. Lookup supports the following attributes:
Event ID
Event name
Event source
Resource name
Resource type
User name
All attributes are optional. The default number of results returned is 10, 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.
This is a variant of lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the forEach helper method
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.cloudtrail.paginators.LookupEventsPublisher publisher = client.lookupEventsPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.cloudtrail.model.LookupEventsResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Note: If you prefer to have control on service calls, use the
lookupEvents(software.amazon.awssdk.services.cloudtrail.model.LookupEventsRequest)
operation.
default CompletableFuture<PutEventSelectorsResponse> putEventSelectors(PutEventSelectorsRequest putEventSelectorsRequest)
Configures an event selector for your trail. Use event selectors to specify whether you want your trail to log management and/or 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 in the AWS CloudTrail User Guide.
putEventSelectorsRequest
- Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
PutEventSelectors
operation is called with an invalid number of event selectors, data resources, or an invalid value for a
parameter:
Specify a valid number of event selectors (1 to 5) for a trail.
Specify a valid number of data resources (1 to 250) for an event selector.
Specify a valid value for a parameter. For example, specifying the ReadWriteType
parameter
with a value of read-only
is invalid.
default CompletableFuture<PutEventSelectorsResponse> putEventSelectors(Consumer<PutEventSelectorsRequest.Builder> putEventSelectorsRequest)
Configures an event selector for your trail. Use event selectors to specify whether you want your trail to log management and/or 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 in the AWS CloudTrail User Guide.
PutEventSelectorsRequest.Builder
avoiding the need
to create one manually via PutEventSelectorsRequest.builder()
putEventSelectorsRequest
- a Consumer
that will call methods on PutEventSelectorsRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
PutEventSelectors
operation is called with an invalid number of event selectors, data resources, or an invalid value for a
parameter:
Specify a valid number of event selectors (1 to 5) for a trail.
Specify a valid number of data resources (1 to 250) for an event selector.
Specify a valid value for a parameter. For example, specifying the ReadWriteType
parameter
with a value of read-only
is invalid.
default CompletableFuture<RemoveTagsResponse> removeTags(RemoveTagsRequest removeTagsRequest)
Removes the specified tags from a trail.
removeTagsRequest
- Specifies the tags to remove from a trail.
arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<RemoveTagsResponse> removeTags(Consumer<RemoveTagsRequest.Builder> removeTagsRequest)
Removes the specified tags from a trail.
RemoveTagsRequest.Builder
avoiding the need to
create one manually via RemoveTagsRequest.builder()
removeTagsRequest
- a Consumer
that will call methods on RemoveTagsRequest.Builder
.
arn:aws:cloudtrail:us-east-1:123456789012:trail/MyTrail
Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$
.default CompletableFuture<StartLoggingResponse> startLogging(StartLoggingRequest startLoggingRequest)
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.
startLoggingRequest
- The request to CloudTrail to start logging AWS API calls for an account.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<StartLoggingResponse> startLogging(Consumer<StartLoggingRequest.Builder> startLoggingRequest)
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.
StartLoggingRequest.Builder
avoiding the need to
create one manually via StartLoggingRequest.builder()
startLoggingRequest
- a Consumer
that will call methods on StartLoggingRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<StopLoggingResponse> stopLogging(StopLoggingRequest stopLoggingRequest)
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.
stopLoggingRequest
- Passes the request to CloudTrail to stop logging AWS API calls for the specified account.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<StopLoggingResponse> stopLogging(Consumer<StopLoggingRequest.Builder> stopLoggingRequest)
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.
StopLoggingRequest.Builder
avoiding the need to
create one manually via StopLoggingRequest.builder()
stopLoggingRequest
- a Consumer
that will call methods on StopLoggingRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<UpdateTrailResponse> updateTrail(UpdateTrailRequest updateTrailRequest)
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.
updateTrailRequest
- Specifies settings to update for the trail.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
default CompletableFuture<UpdateTrailResponse> updateTrail(Consumer<UpdateTrailRequest.Builder> updateTrailRequest)
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.
UpdateTrailRequest.Builder
avoiding the need to
create one manually via UpdateTrailRequest.builder()
updateTrailRequest
- a Consumer
that will call methods on UpdateTrailRequest.Builder
.Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)
Start with a letter or number, and end with a letter or number
Be between 3 and 128 characters
Have no adjacent periods, underscores or dashes. Names like my-_namespace
and
my--namespace
are invalid.
Not be in IP address format (for example, 192.168.5.4)
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.