Struct aws_sdk_cloudtrail::client::Client
source · [−]pub struct Client<C = DynConnector, M = DefaultMiddleware, R = Standard> { /* private fields */ }
Expand description
Client for AWS CloudTrail
Client for invoking operations on AWS CloudTrail. Each operation on AWS CloudTrail is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_cloudtrail::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_cloudtrail::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_cloudtrail::Client::from_conf(config);
Implementations
impl<C, M, R> Client<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
impl<C, M, R> Client<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
Constructs a fluent builder for the AddTags
operation.
- The fluent builder is configurable:
resource_id(impl Into<String>)
/set_resource_id(Option<String>)
:Specifies the ARN of the trail to which one or more tags will be added. The format of a trail ARN is:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
tags_list(Vec<Tag>)
/set_tags_list(Option<Vec<Tag>>)
:Contains a list of tags, up to a limit of 50
- On success, responds with
AddTagsOutput
- On failure, responds with
SdkError<AddTagsError>
Constructs a fluent builder for the CancelQuery
operation.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or the ID suffix of the ARN) of an event data store on which the specified query is running.
query_id(impl Into<String>)
/set_query_id(Option<String>)
:The ID of the query that you want to cancel. The
QueryId
comes from the response of aStartQuery
operation.
- On success, responds with
CancelQueryOutput
with field(s):query_id(Option<String>)
:The ID of the canceled query.
query_status(Option<QueryStatus>)
:Shows the status of a query after a
CancelQuery
request. Typically, the values shown are eitherRUNNING
orCANCELLED
.
- On failure, responds with
SdkError<CancelQueryError>
Constructs a fluent builder for the CreateEventDataStore
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name of the event data store.
advanced_event_selectors(Vec<AdvancedEventSelector>)
/set_advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:The advanced event selectors to use to select the events for the data store. For more information about how to use advanced event selectors, see Log events by using advanced event selectors in the CloudTrail User Guide.
multi_region_enabled(bool)
/set_multi_region_enabled(Option<bool>)
:Specifies whether the event data store includes events from all regions, or only from the region in which the event data store is created.
organization_enabled(bool)
/set_organization_enabled(Option<bool>)
:Specifies whether an event data store collects events logged for an organization in Organizations.
retention_period(i32)
/set_retention_period(Option<i32>)
:The retention period of the event data store, in days. You can set a retention period of up to 2555 days, the equivalent of seven years.
termination_protection_enabled(bool)
/set_termination_protection_enabled(Option<bool>)
:Specifies whether termination protection is enabled for the event data store. If termination protection is enabled, you cannot delete the event data store until termination protection is disabled.
tags_list(Vec<Tag>)
/set_tags_list(Option<Vec<Tag>>)
:A list of tags.
- On success, responds with
CreateEventDataStoreOutput
with field(s):event_data_store_arn(Option<String>)
:The ARN of the event data store.
name(Option<String>)
:The name of the event data store.
status(Option<EventDataStoreStatus>)
:The status of event data store creation.
advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:The advanced event selectors that were used to select the events for the data store.
multi_region_enabled(Option<bool>)
:Indicates whether the event data store collects events from all regions, or only from the region in which it was created.
organization_enabled(Option<bool>)
:Indicates whether an event data store is collecting logged events for an organization in Organizations.
retention_period(Option<i32>)
:The retention period of an event data store, in days.
termination_protection_enabled(Option<bool>)
:Indicates whether termination protection is enabled for the event data store.
tags_list(Option<Vec<Tag>>)
:A list of tags.
created_timestamp(Option<DateTime>)
:The timestamp that shows when the event data store was created.
updated_timestamp(Option<DateTime>)
:The timestamp that shows when an event data store was updated, if applicable.
UpdatedTimestamp
is always either the same or newer than the time shown inCreatedTimestamp
.
- On failure, responds with
SdkError<CreateEventDataStoreError>
Constructs a fluent builder for the CreateTrail
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:Specifies the name of the trail. The name must meet the following requirements:
-
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
andmy–namespace
are not valid. -
Not be in IP address format (for example, 192.168.5.4)
-
s3_bucket_name(impl Into<String>)
/set_s3_bucket_name(Option<String>)
:Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.
s3_key_prefix(impl Into<String>)
/set_s3_key_prefix(Option<String>)
:Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.
sns_topic_name(impl Into<String>)
/set_sns_topic_name(Option<String>)
:Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
include_global_service_events(bool)
/set_include_global_service_events(Option<bool>)
:Specifies whether the trail is publishing events from global services such as IAM to the log files.
is_multi_region_trail(bool)
/set_is_multi_region_trail(Option<bool>)
:Specifies whether the trail is created in the current region or in all regions. The default is false, which creates a trail only in the region where you are signed in. As a best practice, consider creating trails that log events in all regions.
enable_log_file_validation(bool)
/set_enable_log_file_validation(Option<bool>)
:Specifies whether log file integrity validation is enabled. The default is false.
When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.
cloud_watch_logs_log_group_arn(impl Into<String>)
/set_cloud_watch_logs_log_group_arn(Option<String>)
:Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered. Not required unless you specify
CloudWatchLogsRoleArn
.cloud_watch_logs_role_arn(impl Into<String>)
/set_cloud_watch_logs_role_arn(Option<String>)
:Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group.
kms_key_id(impl Into<String>)
/set_kms_key_id(Option<String>)
:Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by “alias/”, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see Using multi-Region keys in the Key Management Service Developer Guide.
Examples:
-
alias/MyAliasName
-
arn:aws:kms:us-east-2:123456789012:alias/MyAliasName
-
arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
-
12345678-1234-1234-1234-123456789012
-
is_organization_trail(bool)
/set_is_organization_trail(Option<bool>)
:Specifies whether the trail is created for all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations.
tags_list(Vec<Tag>)
/set_tags_list(Option<Vec<Tag>>)
:A list of tags.
- On success, responds with
CreateTrailOutput
with field(s):name(Option<String>)
:Specifies the name of the trail.
s3_bucket_name(Option<String>)
:Specifies the name of the Amazon S3 bucket designated for publishing log files.
s3_key_prefix(Option<String>)
:Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files.
sns_topic_name(Option<String>)
:This field is no longer in use. Use SnsTopicARN.
sns_topic_arn(Option<String>)
:Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The format of a topic ARN is:
arn:aws:sns:us-east-2:123456789012:MyTopic
include_global_service_events(Option<bool>)
:Specifies whether the trail is publishing events from global services such as IAM to the log files.
is_multi_region_trail(Option<bool>)
:Specifies whether the trail exists in one region or in all regions.
trail_arn(Option<String>)
:Specifies the ARN of the trail that was created. The format of a trail ARN is:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
log_file_validation_enabled(Option<bool>)
:Specifies whether log file integrity validation is enabled.
cloud_watch_logs_log_group_arn(Option<String>)
:Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.
cloud_watch_logs_role_arn(Option<String>)
:Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group.
kms_key_id(Option<String>)
:Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.
arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
is_organization_trail(Option<bool>)
:Specifies whether the trail is an organization trail.
- On failure, responds with
SdkError<CreateTrailError>
Constructs a fluent builder for the DeleteEventDataStore
operation.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or the ID suffix of the ARN) of the event data store to delete.
- On success, responds with
DeleteEventDataStoreOutput
- On failure, responds with
SdkError<DeleteEventDataStoreError>
Constructs a fluent builder for the DeleteTrail
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:Specifies the name or the CloudTrail ARN of the trail to be deleted. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
- On success, responds with
DeleteTrailOutput
- On failure, responds with
SdkError<DeleteTrailError>
Constructs a fluent builder for the DescribeQuery
operation.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or the ID suffix of the ARN) of an event data store on which the specified query was run.
query_id(impl Into<String>)
/set_query_id(Option<String>)
:The query ID.
- On success, responds with
DescribeQueryOutput
with field(s):query_id(Option<String>)
:The ID of the query.
query_string(Option<String>)
:The SQL code of a query.
query_status(Option<QueryStatus>)
:The status of a query. Values for
QueryStatus
includeQUEUED
,RUNNING
,FINISHED
,FAILED
, orCANCELLED
query_statistics(Option<QueryStatisticsForDescribeQuery>)
:Metadata about a query, including the number of events that were matched, the total number of events scanned, the query run time in milliseconds, and the query’s creation time.
error_message(Option<String>)
:The error message returned if a query failed.
- On failure, responds with
SdkError<DescribeQueryError>
Constructs a fluent builder for the DescribeTrails
operation.
- The fluent builder is configurable:
trail_name_list(Vec<String>)
/set_trail_name_list(Option<Vec<String>>)
:Specifies a list of trail names, trail ARNs, or both, of the trails to describe. The format of a trail ARN is:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
If an empty list is specified, information for the trail in the current region is returned.
-
If an empty list is specified and
IncludeShadowTrails
is false, then information for all trails in the current region is returned. -
If an empty list is specified and IncludeShadowTrails is null or true, then information for all trails in the current region and any associated shadow trails in other regions is returned.
If one or more trail names are specified, information is returned only if the names match the names of trails belonging only to the current region. To return information about a trail in another region, you must specify its trail ARN.
-
include_shadow_trails(bool)
/set_include_shadow_trails(Option<bool>)
:Specifies whether to include shadow trails in the response. A shadow trail is the replication in a region of a trail that was created in a different region, or in the case of an organization trail, the replication of an organization trail in member accounts. If you do not include shadow trails, organization trails in a member account and region replication trails will not be returned. The default is true.
- On success, responds with
DescribeTrailsOutput
with field(s):trail_list(Option<Vec<Trail>>)
:The list of trail objects. Trail objects with string values are only returned if values for the objects exist in a trail’s configuration. For example,
SNSTopicName
andSNSTopicARN
are only returned in results if a trail is configured to send SNS notifications. Similarly,KMSKeyId
only appears in results if a trail’s log files are encrypted with KMS customer managed keys.
- On failure, responds with
SdkError<DescribeTrailsError>
Constructs a fluent builder for the GetEventDataStore
operation.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or ID suffix of the ARN) of the event data store about which you want information.
- On success, responds with
GetEventDataStoreOutput
with field(s):event_data_store_arn(Option<String>)
:The event data store Amazon Resource Number (ARN).
name(Option<String>)
:The name of the event data store.
status(Option<EventDataStoreStatus>)
:The status of an event data store. Values can be
ENABLED
andPENDING_DELETION
.advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:The advanced event selectors used to select events for the data store.
multi_region_enabled(Option<bool>)
:Indicates whether the event data store includes events from all regions, or only from the region in which it was created.
organization_enabled(Option<bool>)
:Indicates whether an event data store is collecting logged events for an organization in Organizations.
retention_period(Option<i32>)
:The retention period of the event data store, in days.
termination_protection_enabled(Option<bool>)
:Indicates that termination protection is enabled.
created_timestamp(Option<DateTime>)
:The timestamp of the event data store’s creation.
updated_timestamp(Option<DateTime>)
:Shows the time that an event data store was updated, if applicable.
UpdatedTimestamp
is always either the same or newer than the time shown inCreatedTimestamp
.
- On failure, responds with
SdkError<GetEventDataStoreError>
Constructs a fluent builder for the GetEventSelectors
operation.
- The fluent builder is configurable:
trail_name(impl Into<String>)
/set_trail_name(Option<String>)
:Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:
-
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
andmy–namespace
are not valid. -
Not be in IP address format (for example, 192.168.5.4)
If you specify a trail ARN, it must be in the format:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
-
- On success, responds with
GetEventSelectorsOutput
with field(s):trail_arn(Option<String>)
:The specified trail ARN that has the event selectors.
event_selectors(Option<Vec<EventSelector>>)
:The event selectors that are configured for the trail.
advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:The advanced event selectors that are configured for the trail.
- On failure, responds with
SdkError<GetEventSelectorsError>
Constructs a fluent builder for the GetInsightSelectors
operation.
- The fluent builder is configurable:
trail_name(impl Into<String>)
/set_trail_name(Option<String>)
:Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:
-
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
andmy–namespace
are not valid. -
Not be in IP address format (for example, 192.168.5.4)
If you specify a trail ARN, it must be in the format:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
-
- On success, responds with
GetInsightSelectorsOutput
with field(s):trail_arn(Option<String>)
:The Amazon Resource Name (ARN) of a trail for which you want to get Insights selectors.
insight_selectors(Option<Vec<InsightSelector>>)
:A JSON string that contains the insight types you want to log on a trail. In this release,
ApiErrorRateInsight
andApiCallRateInsight
are supported as insight types.
- On failure, responds with
SdkError<GetInsightSelectorsError>
Constructs a fluent builder for the GetQueryResults
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or ID suffix of the ARN) of the event data store against which the query was run.
query_id(impl Into<String>)
/set_query_id(Option<String>)
:The ID of the query for which you want to get results.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:A token you can use to get the next page of query results.
max_query_results(i32)
/set_max_query_results(Option<i32>)
:The maximum number of query results to display on a single page.
- On success, responds with
GetQueryResultsOutput
with field(s):query_status(Option<QueryStatus>)
:The status of the query. Values include
QUEUED
,RUNNING
,FINISHED
,FAILED
, orCANCELLED
.query_statistics(Option<QueryStatistics>)
:Shows the count of query results.
query_result_rows(Option<Vec<Vec<HashMap<String, String>>>>)
:Contains the individual event results of the query.
next_token(Option<String>)
:A token you can use to get the next page of query results.
error_message(Option<String>)
:The error message returned if a query failed.
- On failure, responds with
SdkError<GetQueryResultsError>
Constructs a fluent builder for the GetTrail
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:The name or the Amazon Resource Name (ARN) of the trail for which you want to retrieve settings information.
- On success, responds with
GetTrailOutput
with field(s):trail(Option<Trail>)
:The settings for a trail.
- On failure, responds with
SdkError<GetTrailError>
Constructs a fluent builder for the GetTrailStatus
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:Specifies the name or the CloudTrail ARN of the trail for which you are requesting status. To get the status of a shadow trail (a replication of the trail in another region), you must specify its ARN. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
- On success, responds with
GetTrailStatusOutput
with field(s):is_logging(Option<bool>)
:Whether the CloudTrail trail is currently logging Amazon Web Services API calls.
latest_delivery_error(Option<String>)
:Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver log files to the designated bucket. For more information, see Error Responses in the Amazon S3 API Reference.
This error occurs only when there is a problem with the destination S3 bucket, and does not occur for requests that time out. To resolve the issue, create a new bucket, and then call
UpdateTrail
to specify the new bucket; or fix the existing objects so that CloudTrail can again write to the bucket.latest_notification_error(Option<String>)
:Displays any Amazon SNS error that CloudTrail encountered when attempting to send a notification. For more information about Amazon SNS errors, see the Amazon SNS Developer Guide.
latest_delivery_time(Option<DateTime>)
:Specifies the date and time that CloudTrail last delivered log files to an account’s Amazon S3 bucket.
latest_notification_time(Option<DateTime>)
:Specifies the date and time of the most recent Amazon SNS notification that CloudTrail has written a new log file to an account’s Amazon S3 bucket.
start_logging_time(Option<DateTime>)
:Specifies the most recent date and time when CloudTrail started recording API calls for an Amazon Web Services account.
stop_logging_time(Option<DateTime>)
:Specifies the most recent date and time when CloudTrail stopped recording API calls for an Amazon Web Services account.
latest_cloud_watch_logs_delivery_error(Option<String>)
:Displays any CloudWatch Logs error that CloudTrail encountered when attempting to deliver logs to CloudWatch Logs.
latest_cloud_watch_logs_delivery_time(Option<DateTime>)
:Displays the most recent date and time when CloudTrail delivered logs to CloudWatch Logs.
latest_digest_delivery_time(Option<DateTime>)
:Specifies the date and time that CloudTrail last delivered a digest file to an account’s Amazon S3 bucket.
latest_digest_delivery_error(Option<String>)
:Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver a digest file to the designated bucket. For more information, see Error Responses in the Amazon S3 API Reference.
This error occurs only when there is a problem with the destination S3 bucket, and does not occur for requests that time out. To resolve the issue, create a new bucket, and then call
UpdateTrail
to specify the new bucket; or fix the existing objects so that CloudTrail can again write to the bucket.latest_delivery_attempt_time(Option<String>)
:This field is no longer in use.
latest_notification_attempt_time(Option<String>)
:This field is no longer in use.
latest_notification_attempt_succeeded(Option<String>)
:This field is no longer in use.
latest_delivery_attempt_succeeded(Option<String>)
:This field is no longer in use.
time_logging_started(Option<String>)
:This field is no longer in use.
time_logging_stopped(Option<String>)
:This field is no longer in use.
- On failure, responds with
SdkError<GetTrailStatusError>
Constructs a fluent builder for the ListEventDataStores
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:A token you can use to get the next page of event data store results.
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of event data stores to display on a single page.
- On success, responds with
ListEventDataStoresOutput
with field(s):event_data_stores(Option<Vec<EventDataStore>>)
:Contains information about event data stores in the account, in the current region.
next_token(Option<String>)
:A token you can use to get the next page of results.
- On failure, responds with
SdkError<ListEventDataStoresError>
Constructs a fluent builder for the ListPublicKeys
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
start_time(DateTime)
/set_start_time(Option<DateTime>)
:Optionally specifies, in UTC, the start of the time range to look up public keys for CloudTrail digest files. If not specified, the current time is used, and the current public key is returned.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:Optionally specifies, in UTC, the end of the time range to look up public keys for CloudTrail digest files. If not specified, the current time is used.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:Reserved for future use.
- On success, responds with
ListPublicKeysOutput
with field(s):public_key_list(Option<Vec<PublicKey>>)
:Contains an array of PublicKey objects.
The returned public keys may have validity time ranges that overlap.
next_token(Option<String>)
:Reserved for future use.
- On failure, responds with
SdkError<ListPublicKeysError>
Constructs a fluent builder for the ListQueries
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or the ID suffix of the ARN) of an event data store on which queries were run.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:A token you can use to get the next page of results.
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of queries to show on a page.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:Use with
EndTime
to bound aListQueries
request, and limit its results to only those queries run within a specified time period.end_time(DateTime)
/set_end_time(Option<DateTime>)
:Use with
StartTime
to bound aListQueries
request, and limit its results to only those queries run within a specified time period.query_status(QueryStatus)
/set_query_status(Option<QueryStatus>)
:The status of queries that you want to return in results. Valid values for
QueryStatus
includeQUEUED
,RUNNING
,FINISHED
,FAILED
, orCANCELLED
.
- On success, responds with
ListQueriesOutput
with field(s):queries(Option<Vec<Query>>)
:Lists matching query results, and shows query ID, status, and creation time of each query.
next_token(Option<String>)
:A token you can use to get the next page of results.
- On failure, responds with
SdkError<ListQueriesError>
Constructs a fluent builder for the ListTags
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
resource_id_list(Vec<String>)
/set_resource_id_list(Option<Vec<String>>)
:Specifies a list of trail ARNs whose tags will be listed. The list has a limit of 20 ARNs. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
next_token(impl Into<String>)
/set_next_token(Option<String>)
:Reserved for future use.
- On success, responds with
ListTagsOutput
with field(s):resource_tag_list(Option<Vec<ResourceTag>>)
:A list of resource tags.
next_token(Option<String>)
:Reserved for future use.
- On failure, responds with
SdkError<ListTagsError>
Constructs a fluent builder for the ListTrails
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of ‘Username’ with a value of ‘root’, the call with NextToken should include those same parameters.
- On success, responds with
ListTrailsOutput
with field(s):trails(Option<Vec<TrailInfo>>)
:Returns the name, ARN, and home region of trails in the current account.
next_token(Option<String>)
:The token to use to get the next page of results after a previous API call. If the token does not appear, there are no more results to return. The token must be passed in with the same parameters as the previous call. For example, if the original call specified an AttributeKey of ‘Username’ with a value of ‘root’, the call with NextToken should include those same parameters.
- On failure, responds with
SdkError<ListTrailsError>
Constructs a fluent builder for the LookupEvents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
lookup_attributes(Vec<LookupAttribute>)
/set_lookup_attributes(Option<Vec<LookupAttribute>>)
:Contains a list of lookup attributes. Currently the list can contain only one item.
start_time(DateTime)
/set_start_time(Option<DateTime>)
:Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.
end_time(DateTime)
/set_end_time(Option<DateTime>)
:Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.
event_category(EventCategory)
/set_event_category(Option<EventCategory>)
:Specifies the event category. If you do not specify an event category, events of the category are not returned in the response. For example, if you do not specify
insight
as the value ofEventCategory
, no Insights events are returned.max_results(i32)
/set_max_results(Option<i32>)
:The number of events to return. Possible values are 1 through 50. The default is 50.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the the original call. For example, if the original call specified an AttributeKey of ‘Username’ with a value of ‘root’, the call with NextToken should include those same parameters.
- On success, responds with
LookupEventsOutput
with field(s):events(Option<Vec<Event>>)
:A list of events returned based on the lookup attributes specified and the CloudTrail event. The events list is sorted by time. The most recent event is listed first.
next_token(Option<String>)
:The token to use to get the next page of results after a previous API call. If the token does not appear, there are no more results to return. The token must be passed in with the same parameters as the previous call. For example, if the original call specified an AttributeKey of ‘Username’ with a value of ‘root’, the call with NextToken should include those same parameters.
- On failure, responds with
SdkError<LookupEventsError>
Constructs a fluent builder for the PutEventSelectors
operation.
- The fluent builder is configurable:
trail_name(impl Into<String>)
/set_trail_name(Option<String>)
:Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:
-
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
andmy–namespace
are not valid. -
Not be in IP address format (for example, 192.168.5.4)
If you specify a trail ARN, it must be in the following format.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
-
event_selectors(Vec<EventSelector>)
/set_event_selectors(Option<Vec<EventSelector>>)
:Specifies the settings for your event selectors. You can configure up to five event selectors for a trail. You can use either
EventSelectors
orAdvancedEventSelectors
in aPutEventSelectors
request, but not both. If you applyEventSelectors
to a trail, any existingAdvancedEventSelectors
are overwritten.advanced_event_selectors(Vec<AdvancedEventSelector>)
/set_advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:Specifies the settings for advanced event selectors. You can add advanced event selectors, and conditions for your advanced event selectors, up to a maximum of 500 values for all conditions and selectors on a trail. You can use either
AdvancedEventSelectors
orEventSelectors
, but not both. If you applyAdvancedEventSelectors
to a trail, any existingEventSelectors
are overwritten. For more information about advanced event selectors, see Logging data events for trails in the CloudTrail User Guide.
- On success, responds with
PutEventSelectorsOutput
with field(s):trail_arn(Option<String>)
:Specifies the ARN of the trail that was updated with event selectors. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
event_selectors(Option<Vec<EventSelector>>)
:Specifies the event selectors configured for your trail.
advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:Specifies the advanced event selectors configured for your trail.
- On failure, responds with
SdkError<PutEventSelectorsError>
Constructs a fluent builder for the PutInsightSelectors
operation.
- The fluent builder is configurable:
trail_name(impl Into<String>)
/set_trail_name(Option<String>)
:The name of the CloudTrail trail for which you want to change or add Insights selectors.
insight_selectors(Vec<InsightSelector>)
/set_insight_selectors(Option<Vec<InsightSelector>>)
:A JSON string that contains the insight types you want to log on a trail.
ApiCallRateInsight
andApiErrorRateInsight
are valid insight types.
- On success, responds with
PutInsightSelectorsOutput
with field(s):trail_arn(Option<String>)
:The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
insight_selectors(Option<Vec<InsightSelector>>)
:A JSON string that contains the Insights event types that you want to log on a trail. The valid Insights types in this release are
ApiErrorRateInsight
andApiCallRateInsight
.
- On failure, responds with
SdkError<PutInsightSelectorsError>
Constructs a fluent builder for the RemoveTags
operation.
- The fluent builder is configurable:
resource_id(impl Into<String>)
/set_resource_id(Option<String>)
:Specifies the ARN of the trail from which tags should be removed. The format of a trail ARN is:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
tags_list(Vec<Tag>)
/set_tags_list(Option<Vec<Tag>>)
:Specifies a list of tags to be removed.
- On success, responds with
RemoveTagsOutput
- On failure, responds with
SdkError<RemoveTagsError>
Constructs a fluent builder for the RestoreEventDataStore
operation.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or the ID suffix of the ARN) of the event data store that you want to restore.
- On success, responds with
RestoreEventDataStoreOutput
with field(s):event_data_store_arn(Option<String>)
:The event data store ARN.
name(Option<String>)
:The name of the event data store.
status(Option<EventDataStoreStatus>)
:The status of the event data store.
advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:The advanced event selectors that were used to select events.
multi_region_enabled(Option<bool>)
:Indicates whether the event data store is collecting events from all regions, or only from the region in which the event data store was created.
organization_enabled(Option<bool>)
:Indicates whether an event data store is collecting logged events for an organization in Organizations.
retention_period(Option<i32>)
:The retention period, in days.
termination_protection_enabled(Option<bool>)
:Indicates that termination protection is enabled and the event data store cannot be automatically deleted.
created_timestamp(Option<DateTime>)
:The timestamp of an event data store’s creation.
updated_timestamp(Option<DateTime>)
:The timestamp that shows when an event data store was updated, if applicable.
UpdatedTimestamp
is always either the same or newer than the time shown inCreatedTimestamp
.
- On failure, responds with
SdkError<RestoreEventDataStoreError>
Constructs a fluent builder for the StartLogging
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:Specifies the name or the CloudTrail ARN of the trail for which CloudTrail logs Amazon Web Services API calls. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
- On success, responds with
StartLoggingOutput
- On failure, responds with
SdkError<StartLoggingError>
Constructs a fluent builder for the StartQuery
operation.
- The fluent builder is configurable:
query_statement(impl Into<String>)
/set_query_statement(Option<String>)
:The SQL code of your query.
- On success, responds with
StartQueryOutput
with field(s):query_id(Option<String>)
:The ID of the started query.
- On failure, responds with
SdkError<StartQueryError>
Constructs a fluent builder for the StopLogging
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:Specifies the name or the CloudTrail ARN of the trail for which CloudTrail will stop logging Amazon Web Services API calls. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
- On success, responds with
StopLoggingOutput
- On failure, responds with
SdkError<StopLoggingError>
Constructs a fluent builder for the UpdateEventDataStore
operation.
- The fluent builder is configurable:
event_data_store(impl Into<String>)
/set_event_data_store(Option<String>)
:The ARN (or the ID suffix of the ARN) of the event data store that you want to update.
name(impl Into<String>)
/set_name(Option<String>)
:The event data store name.
advanced_event_selectors(Vec<AdvancedEventSelector>)
/set_advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:The advanced event selectors used to select events for the event data store.
multi_region_enabled(bool)
/set_multi_region_enabled(Option<bool>)
:Specifies whether an event data store collects events from all regions, or only from the region in which it was created.
organization_enabled(bool)
/set_organization_enabled(Option<bool>)
:Specifies whether an event data store collects events logged for an organization in Organizations.
retention_period(i32)
/set_retention_period(Option<i32>)
:The retention period, in days.
termination_protection_enabled(bool)
/set_termination_protection_enabled(Option<bool>)
:Indicates that termination protection is enabled and the event data store cannot be automatically deleted.
- On success, responds with
UpdateEventDataStoreOutput
with field(s):event_data_store_arn(Option<String>)
:The ARN of the event data store.
name(Option<String>)
:The name of the event data store.
status(Option<EventDataStoreStatus>)
:The status of an event data store. Values can be
ENABLED
andPENDING_DELETION
.advanced_event_selectors(Option<Vec<AdvancedEventSelector>>)
:The advanced event selectors that are applied to the event data store.
multi_region_enabled(Option<bool>)
:Indicates whether the event data store includes events from all regions, or only from the region in which it was created.
organization_enabled(Option<bool>)
:Indicates whether an event data store is collecting logged events for an organization in Organizations.
retention_period(Option<i32>)
:The retention period, in days.
termination_protection_enabled(Option<bool>)
:Indicates whether termination protection is enabled for the event data store.
created_timestamp(Option<DateTime>)
:The timestamp that shows when an event data store was first created.
updated_timestamp(Option<DateTime>)
:The timestamp that shows when the event data store was last updated.
UpdatedTimestamp
is always either the same or newer than the time shown inCreatedTimestamp
.
- On failure, responds with
SdkError<UpdateEventDataStoreError>
Constructs a fluent builder for the UpdateTrail
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:Specifies the name of the trail or trail ARN. If
Name
is a trail name, the string must meet the following requirements:-
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
andmy–namespace
are not valid. -
Not be in IP address format (for example, 192.168.5.4)
If
Name
is a trail ARN, it must be in the following format.arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
-
s3_bucket_name(impl Into<String>)
/set_s3_bucket_name(Option<String>)
:Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.
s3_key_prefix(impl Into<String>)
/set_s3_key_prefix(Option<String>)
:Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your CloudTrail Log Files. The maximum length is 200 characters.
sns_topic_name(impl Into<String>)
/set_sns_topic_name(Option<String>)
:Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
include_global_service_events(bool)
/set_include_global_service_events(Option<bool>)
:Specifies whether the trail is publishing events from global services such as IAM to the log files.
is_multi_region_trail(bool)
/set_is_multi_region_trail(Option<bool>)
:Specifies whether the trail applies only to the current region or to all regions. The default is false. If the trail exists only in the current region and this value is set to true, shadow trails (replications of the trail) will be created in the other regions. If the trail exists in all regions and this value is set to false, the trail will remain in the region where it was created, and its shadow trails in other regions will be deleted. As a best practice, consider using trails that log events in all regions.
enable_log_file_validation(bool)
/set_enable_log_file_validation(Option<bool>)
:Specifies whether log file validation is enabled. The default is false.
When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.
cloud_watch_logs_log_group_arn(impl Into<String>)
/set_cloud_watch_logs_log_group_arn(Option<String>)
:Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. Not required unless you specify
CloudWatchLogsRoleArn
.cloud_watch_logs_role_arn(impl Into<String>)
/set_cloud_watch_logs_role_arn(Option<String>)
:Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group.
kms_key_id(impl Into<String>)
/set_kms_key_id(Option<String>)
:Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. The value can be an alias name prefixed by “alias/”, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see Using multi-Region keys in the Key Management Service Developer Guide.
Examples:
-
alias/MyAliasName
-
arn:aws:kms:us-east-2:123456789012:alias/MyAliasName
-
arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
-
12345678-1234-1234-1234-123456789012
-
is_organization_trail(bool)
/set_is_organization_trail(Option<bool>)
:Specifies whether the trail is applied to all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations. If the trail is not an organization trail and this is set to
true
, the trail will be created in all Amazon Web Services accounts that belong to the organization. If the trail is an organization trail and this is set tofalse
, the trail will remain in the current Amazon Web Services account but be deleted from all member accounts in the organization.
- On success, responds with
UpdateTrailOutput
with field(s):name(Option<String>)
:Specifies the name of the trail.
s3_bucket_name(Option<String>)
:Specifies the name of the Amazon S3 bucket designated for publishing log files.
s3_key_prefix(Option<String>)
:Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see Finding Your IAM Log Files.
sns_topic_name(Option<String>)
:This field is no longer in use. Use
UpdateTrailResponse$SnsTopicARN
.sns_topic_arn(Option<String>)
:Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications when log files are delivered. The following is the format of a topic ARN.
arn:aws:sns:us-east-2:123456789012:MyTopic
include_global_service_events(Option<bool>)
:Specifies whether the trail is publishing events from global services such as IAM to the log files.
is_multi_region_trail(Option<bool>)
:Specifies whether the trail exists in one region or in all regions.
trail_arn(Option<String>)
:Specifies the ARN of the trail that was updated. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
log_file_validation_enabled(Option<bool>)
:Specifies whether log file integrity validation is enabled.
cloud_watch_logs_log_group_arn(Option<String>)
:Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered.
cloud_watch_logs_role_arn(Option<String>)
:Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group.
kms_key_id(Option<String>)
:Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. The value is a fully specified ARN to a KMS key in the following format.
arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012
is_organization_trail(Option<bool>)
:Specifies whether the trail is an organization trail.
- On failure, responds with
SdkError<UpdateTrailError>
Creates a client with the given service config and connector override.
Trait Implementations
Auto Trait Implementations
impl<C = DynConnector, M = DefaultMiddleware, R = Standard> !RefUnwindSafe for Client<C, M, R>
impl<C = DynConnector, M = DefaultMiddleware, R = Standard> !UnwindSafe for Client<C, M, R>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more