Struct aws_sdk_cloudtrail::Client

source ·
pub struct Client { /* 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.

§Constructing a Client

A Config is required to construct a client. For most use cases, the aws-config crate should be used to automatically resolve this config using aws_config::load_from_env(), since this will resolve an SdkConfig which can be shared across multiple different AWS SDK clients. This config resolution process can be customized by calling aws_config::from_env() instead, which returns a ConfigLoader that uses the builder pattern to customize the default config.

In the simplest case, creating a client looks as follows:

let config = aws_config::load_from_env().await;
let client = aws_sdk_cloudtrail::Client::new(&config);

Occasionally, SDKs may have additional service-specific values that can be set on the Config that is absent from SdkConfig, or slightly different settings for a specific client may be desired. The Config struct implements From<&SdkConfig>, so setting these specific settings can be done as follows:

let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_cloudtrail::config::Builder::from(&sdk_config)
    .some_service_specific_setting("value")
    .build();

See the aws-config docs and Config for more information on customizing configuration.

Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.

§Using the Client

A client has a function for every operation that can be performed by the service. For example, the AddTags operation has a Client::add_tags, function which returns a builder for that operation. The fluent builder ultimately has a send() function that returns an async future that returns a result, as illustrated below:

let result = client.add_tags()
    .resource_id("example")
    .send()
    .await;

The underlying HTTP requests that get made by this can be modified with the customize_operation function on the fluent builder. See the customize module for more information.

Implementations§

source§

impl Client

source

pub fn add_tags(&self) -> AddTagsFluentBuilder

Constructs a fluent builder for the AddTags operation.

  • The fluent builder is configurable:
    • resource_id(impl Into<String>) / set_resource_id(Option<String>):
      required: true

      Specifies the ARN of the trail, event data store, or channel 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

      The format of an event data store ARN is: arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE

      The format of a channel ARN is: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890


    • tags_list(Tag) / set_tags_list(Option<Vec::<Tag>>):
      required: true

      Contains a list of tags, up to a limit of 50


  • On success, responds with AddTagsOutput
  • On failure, responds with SdkError<AddTagsError>
source§

impl Client

source

pub fn cancel_query(&self) -> CancelQueryFluentBuilder

Constructs a fluent builder for the CancelQuery operation.

source§

impl Client

source

pub fn create_channel(&self) -> CreateChannelFluentBuilder

Constructs a fluent builder for the CreateChannel operation.

source§

impl Client

source

pub fn create_event_data_store(&self) -> CreateEventDataStoreFluentBuilder

Constructs a fluent builder for the CreateEventDataStore operation.

source§

impl Client

source

pub fn create_trail(&self) -> CreateTrailFluentBuilder

Constructs a fluent builder for the CreateTrail operation.

source§

impl Client

source

pub fn delete_channel(&self) -> DeleteChannelFluentBuilder

Constructs a fluent builder for the DeleteChannel operation.

source§

impl Client

source

pub fn delete_event_data_store(&self) -> DeleteEventDataStoreFluentBuilder

Constructs a fluent builder for the DeleteEventDataStore operation.

source§

impl Client

source

pub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder

Constructs a fluent builder for the DeleteResourcePolicy operation.

source§

impl Client

source

pub fn delete_trail(&self) -> DeleteTrailFluentBuilder

Constructs a fluent builder for the DeleteTrail operation.

source§

impl Client

source

pub fn deregister_organization_delegated_admin( &self ) -> DeregisterOrganizationDelegatedAdminFluentBuilder

Constructs a fluent builder for the DeregisterOrganizationDelegatedAdmin operation.

source§

impl Client

source

pub fn describe_query(&self) -> DescribeQueryFluentBuilder

Constructs a fluent builder for the DescribeQuery operation.

source§

impl Client

source

pub fn describe_trails(&self) -> DescribeTrailsFluentBuilder

Constructs a fluent builder for the DescribeTrails operation.

  • The fluent builder is configurable:
    • trail_name_list(impl Into<String>) / set_trail_name_list(Option<Vec::<String>>):
      required: false

      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 and current account. 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>):
      required: false

      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 and SNSTopicARN 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>
source§

impl Client

source

pub fn disable_federation(&self) -> DisableFederationFluentBuilder

Constructs a fluent builder for the DisableFederation operation.

source§

impl Client

source

pub fn enable_federation(&self) -> EnableFederationFluentBuilder

Constructs a fluent builder for the EnableFederation operation.

source§

impl Client

source

pub fn get_channel(&self) -> GetChannelFluentBuilder

Constructs a fluent builder for the GetChannel operation.

  • The fluent builder is configurable:
  • On success, responds with GetChannelOutput with field(s):
    • channel_arn(Option<String>):

      The ARN of an channel returned by a GetChannel request.

    • name(Option<String>):

      The name of the CloudTrail channel. For service-linked channels, the name is aws-service-channel/service-name/custom-suffix where service-name represents the name of the Amazon Web Services service that created the channel and custom-suffix represents the suffix generated by the Amazon Web Services service.

    • source(Option<String>):

      The source for the CloudTrail channel.

    • source_config(Option<SourceConfig>):

      Provides information about the advanced event selectors configured for the channel, and whether the channel applies to all Regions or a single Region.

    • destinations(Option<Vec::<Destination>>):

      The destinations for the channel. For channels created for integrations, the destinations are the event data stores that log events arriving through the channel. For service-linked channels, the destination is the Amazon Web Services service that created the service-linked channel to receive events.

    • ingestion_status(Option<IngestionStatus>):

      A table showing information about the most recent successful and failed attempts to ingest events.

  • On failure, responds with SdkError<GetChannelError>
source§

impl Client

source

pub fn get_event_data_store(&self) -> GetEventDataStoreFluentBuilder

Constructs a fluent builder for the GetEventDataStore operation.

source§

impl Client

source

pub fn get_event_selectors(&self) -> GetEventSelectorsFluentBuilder

Constructs a fluent builder for the GetEventSelectors operation.

source§

impl Client

source

pub fn get_import(&self) -> GetImportFluentBuilder

Constructs a fluent builder for the GetImport operation.

source§

impl Client

source

pub fn get_insight_selectors(&self) -> GetInsightSelectorsFluentBuilder

Constructs a fluent builder for the GetInsightSelectors operation.

  • The fluent builder is configurable:
    • trail_name(impl Into<String>) / set_trail_name(Option<String>):
      required: false

      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 and my–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

      You cannot use this parameter with the EventDataStore parameter.


    • event_data_store(impl Into<String>) / set_event_data_store(Option<String>):
      required: false

      Specifies the ARN (or ID suffix of the ARN) of the event data store for which you want to get Insights selectors.

      You cannot use this parameter with the TrailName parameter.


  • On success, responds with GetInsightSelectorsOutput with field(s):
  • On failure, responds with SdkError<GetInsightSelectorsError>
source§

impl Client

source

pub fn get_query_results(&self) -> GetQueryResultsFluentBuilder

Constructs a fluent builder for the GetQueryResults operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn get_resource_policy(&self) -> GetResourcePolicyFluentBuilder

Constructs a fluent builder for the GetResourcePolicy operation.

source§

impl Client

source

pub fn get_trail(&self) -> GetTrailFluentBuilder

Constructs a fluent builder for the GetTrail operation.

source§

impl Client

source

pub fn get_trail_status(&self) -> GetTrailStatusFluentBuilder

Constructs a fluent builder for the GetTrailStatus operation.

source§

impl Client

source

pub fn list_channels(&self) -> ListChannelsFluentBuilder

Constructs a fluent builder for the ListChannels operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_event_data_stores(&self) -> ListEventDataStoresFluentBuilder

Constructs a fluent builder for the ListEventDataStores operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_import_failures(&self) -> ListImportFailuresFluentBuilder

Constructs a fluent builder for the ListImportFailures operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_imports(&self) -> ListImportsFluentBuilder

Constructs a fluent builder for the ListImports operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_insights_metric_data(&self) -> ListInsightsMetricDataFluentBuilder

Constructs a fluent builder for the ListInsightsMetricData operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_public_keys(&self) -> ListPublicKeysFluentBuilder

Constructs a fluent builder for the ListPublicKeys operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_queries(&self) -> ListQueriesFluentBuilder

Constructs a fluent builder for the ListQueries operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_tags(&self) -> ListTagsFluentBuilder

Constructs a fluent builder for the ListTags operation. This operation supports pagination; See into_paginator().

source§

impl Client

source

pub fn list_trails(&self) -> ListTrailsFluentBuilder

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>):
      required: false

      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 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>
source§

impl Client

source

pub fn lookup_events(&self) -> LookupEventsFluentBuilder

Constructs a fluent builder for the LookupEvents operation. This operation supports pagination; See into_paginator().

  • The fluent builder is configurable:
  • 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>
source§

impl Client

source

pub fn put_event_selectors(&self) -> PutEventSelectorsFluentBuilder

Constructs a fluent builder for the PutEventSelectors operation.

  • The fluent builder is configurable:
    • trail_name(impl Into<String>) / set_trail_name(Option<String>):
      required: true

      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 and my–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(EventSelector) / set_event_selectors(Option<Vec::<EventSelector>>):
      required: false

      Specifies the settings for your event selectors. You can configure up to five event selectors for a trail. You can use either EventSelectors or AdvancedEventSelectors in a PutEventSelectors request, but not both. If you apply EventSelectors to a trail, any existing AdvancedEventSelectors are overwritten.


    • advanced_event_selectors(AdvancedEventSelector) / set_advanced_event_selectors(Option<Vec::<AdvancedEventSelector>>):
      required: false

      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 or EventSelectors, but not both. If you apply AdvancedEventSelectors to a trail, any existing EventSelectors are overwritten. For more information about advanced event selectors, see Logging data events in the CloudTrail User Guide.


  • On success, responds with PutEventSelectorsOutput with field(s):
  • On failure, responds with SdkError<PutEventSelectorsError>
source§

impl Client

source

pub fn put_insight_selectors(&self) -> PutInsightSelectorsFluentBuilder

Constructs a fluent builder for the PutInsightSelectors operation.

source§

impl Client

source

pub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder

Constructs a fluent builder for the PutResourcePolicy operation.

source§

impl Client

source

pub fn register_organization_delegated_admin( &self ) -> RegisterOrganizationDelegatedAdminFluentBuilder

Constructs a fluent builder for the RegisterOrganizationDelegatedAdmin operation.

source§

impl Client

source

pub fn remove_tags(&self) -> RemoveTagsFluentBuilder

Constructs a fluent builder for the RemoveTags operation.

source§

impl Client

source

pub fn restore_event_data_store(&self) -> RestoreEventDataStoreFluentBuilder

Constructs a fluent builder for the RestoreEventDataStore operation.

source§

impl Client

source

pub fn start_event_data_store_ingestion( &self ) -> StartEventDataStoreIngestionFluentBuilder

Constructs a fluent builder for the StartEventDataStoreIngestion operation.

source§

impl Client

source

pub fn start_import(&self) -> StartImportFluentBuilder

Constructs a fluent builder for the StartImport operation.

source§

impl Client

source

pub fn start_logging(&self) -> StartLoggingFluentBuilder

Constructs a fluent builder for the StartLogging operation.

source§

impl Client

source

pub fn start_query(&self) -> StartQueryFluentBuilder

Constructs a fluent builder for the StartQuery operation.

source§

impl Client

source

pub fn stop_event_data_store_ingestion( &self ) -> StopEventDataStoreIngestionFluentBuilder

Constructs a fluent builder for the StopEventDataStoreIngestion operation.

source§

impl Client

source

pub fn stop_import(&self) -> StopImportFluentBuilder

Constructs a fluent builder for the StopImport operation.

source§

impl Client

source

pub fn stop_logging(&self) -> StopLoggingFluentBuilder

Constructs a fluent builder for the StopLogging operation.

source§

impl Client

source

pub fn update_channel(&self) -> UpdateChannelFluentBuilder

Constructs a fluent builder for the UpdateChannel operation.

source§

impl Client

source

pub fn update_event_data_store(&self) -> UpdateEventDataStoreFluentBuilder

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>):
      required: true

      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>):
      required: false

      The event data store name.


    • advanced_event_selectors(AdvancedEventSelector) / set_advanced_event_selectors(Option<Vec::<AdvancedEventSelector>>):
      required: false

      The advanced event selectors used to select events for the event data store. You can configure up to five advanced event selectors for each event data store.


    • multi_region_enabled(bool) / set_multi_region_enabled(Option<bool>):
      required: false

      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>):
      required: false

      Specifies whether an event data store collects events logged for an organization in Organizations.

      Only the management account for the organization can convert an organization event data store to a non-organization event data store, or convert a non-organization event data store to an organization event data store.


    • retention_period(i32) / set_retention_period(Option<i32>):
      required: false

      The retention period of the event data store, in days. If BillingMode is set to EXTENDABLE_RETENTION_PRICING, you can set a retention period of up to 3653 days, the equivalent of 10 years. If BillingMode is set to FIXED_RETENTION_PRICING, you can set a retention period of up to 2557 days, the equivalent of seven years.

      CloudTrail Lake determines whether to retain an event by checking if the eventTime of the event is within the specified retention period. For example, if you set a retention period of 90 days, CloudTrail will remove events when the eventTime is older than 90 days.

      If you decrease the retention period of an event data store, CloudTrail will remove any events with an eventTime older than the new retention period. For example, if the previous retention period was 365 days and you decrease it to 100 days, CloudTrail will remove events with an eventTime older than 100 days.


    • termination_protection_enabled(bool) / set_termination_protection_enabled(Option<bool>):
      required: false

      Indicates that termination protection is enabled and the event data store cannot be automatically deleted.


    • kms_key_id(impl Into<String>) / set_kms_key_id(Option<String>):
      required: false

      Specifies the KMS key ID to use to encrypt the events 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.

      Disabling or deleting the KMS key, or removing CloudTrail permissions on the key, prevents CloudTrail from logging events to the event data store, and prevents users from querying the data in the event data store that was encrypted with the key. After you associate an event data store with a KMS key, the KMS key cannot be removed or changed. Before you disable or delete a KMS key that you are using with an event data store, delete or back up your event data store.

      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


    • billing_mode(BillingMode) / set_billing_mode(Option<BillingMode>):
      required: false

      You can’t change the billing mode from EXTENDABLE_RETENTION_PRICING to FIXED_RETENTION_PRICING. If BillingMode is set to EXTENDABLE_RETENTION_PRICING and you want to use FIXED_RETENTION_PRICING instead, you’ll need to stop ingestion on the event data store and create a new event data store that uses FIXED_RETENTION_PRICING.

      The billing mode for the event data store determines the cost for ingesting events and the default and maximum retention period for the event data store.

      The following are the possible values:

      • EXTENDABLE_RETENTION_PRICING - This billing mode is generally recommended if you want a flexible retention period of up to 3653 days (about 10 years). The default retention period for this billing mode is 366 days.

      • FIXED_RETENTION_PRICING - This billing mode is recommended if you expect to ingest more than 25 TB of event data per month and need a retention period of up to 2557 days (about 7 years). The default retention period for this billing mode is 2557 days.

      For more information about CloudTrail pricing, see CloudTrail Pricing and Managing CloudTrail Lake costs.


  • On success, responds with UpdateEventDataStoreOutput with field(s):
  • On failure, responds with SdkError<UpdateEventDataStoreError>
source§

impl Client

source

pub fn update_trail(&self) -> UpdateTrailFluentBuilder

Constructs a fluent builder for the UpdateTrail operation.

  • The fluent builder is configurable:
    • name(impl Into<String>) / set_name(Option<String>):
      required: true

      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 and my–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>):
      required: false

      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>):
      required: false

      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>):
      required: false

      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>):
      required: false

      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>):
      required: false

      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>):
      required: false

      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>):
      required: false

      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. You must use a log group that exists in your account.

      Not required unless you specify CloudWatchLogsRoleArn.


    • cloud_watch_logs_role_arn(impl Into<String>) / set_cloud_watch_logs_role_arn(Option<String>):
      required: false

      Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group. You must use a role that exists in your account.


    • kms_key_id(impl Into<String>) / set_kms_key_id(Option<String>):
      required: false

      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>):
      required: false

      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 to false, the trail will remain in the current Amazon Web Services account but be deleted from all member accounts in the organization.

      Only the management account for the organization can convert an organization trail to a non-organization trail, or convert a non-organization trail to an organization trail.


  • On success, responds with UpdateTrailOutput with field(s):
  • On failure, responds with SdkError<UpdateTrailError>
source§

impl Client

source

pub fn from_conf(conf: Config) -> Self

Creates a new client from the service Config.

§Panics

This method will panic in the following cases:

  • Retries or timeouts are enabled without a sleep_impl configured.
  • Identity caching is enabled without a sleep_impl and time_source configured.
  • No behavior_version is provided.

The panic message for each of these will have instructions on how to resolve them.

source

pub fn config(&self) -> &Config

Returns the client’s configuration.

source§

impl Client

source

pub fn new(sdk_config: &SdkConfig) -> Self

Creates a new client from an SDK Config.

§Panics
  • This method will panic if the sdk_config is missing an async sleep implementation. If you experience this panic, set the sleep_impl on the Config passed into this function to fix it.
  • This method will panic if the sdk_config is missing an HTTP connector. If you experience this panic, set the http_connector on the Config passed into this function to fix it.
  • This method will panic if no BehaviorVersion is provided. If you experience this panic, set behavior_version on the Config or enable the behavior-version-latest Cargo feature.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more