CloudTrailClient.update_trail
rboto-cloudtrail==0.4.0 · Service index · Types
Model summary (excerpt): Updates trail settings that control what events you are logging, and how to handle 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...
Install and imports
Signature
async def update_trail(
*,
name: str,
s3_bucket_name: str | None = None,
s3_key_prefix: str | None = None,
sns_topic_name: str | None = None,
include_global_service_events: bool | None = None,
is_multi_region_trail: bool | None = None,
enable_log_file_validation: bool | None = None,
cloud_watch_logs_log_group_arn: str | None = None,
cloud_watch_logs_role_arn: str | None = None,
kms_key_id: str | None = None,
is_organization_trail: bool | None = None,
recursive_logging: bool | None = None,
) -> UpdateTrailOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
name |
Yes | 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... |
s3_bucket_name |
No | Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket naming rules . |
s3_key_prefix |
No | 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 |
No | Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters. |
include_global_service_events |
No | Specifies whether the trail is publishing events from global services such as IAM to the log files. Setting this value to true only delivers global service events to the trail if the trail is multi-Region or if the trail's home Region is the partition leader Region (for example, us-east-1). |
is_multi_region_trail |
No | 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... |
enable_log_file_validation |
No | 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,... |
cloud_watch_logs_log_group_arn |
No | 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 |
No | 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 |
No | Specifies the KMS key ID to use to encrypt the logs and digest files 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... |
is_organization_trail |
No | 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... |
recursive_logging |
No | Specifies whether recursive logging is enabled for the trail. If you set RecursiveLogging to false , CloudTrail suppresses events generated by CloudTrail when it delivers log files to your trail's destinations, including Amazon S3 and CloudWatch Logs. The default value is true . |
Output
UpdateTrailOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
name |
str | None |
Always present | — |
s3_bucket_name |
str | None |
Always present | — |
s3_key_prefix |
str | None |
Always present | — |
sns_topic_name |
str | None |
Always present | — |
sns_topic_arn |
str | None |
Always present | — |
include_global_service_events |
bool | None |
Always present | — |
is_multi_region_trail |
bool | None |
Always present | — |
trail_arn |
str | None |
Always present | — |
log_file_validation_enabled |
bool | None |
Always present | — |
cloud_watch_logs_log_group_arn |
str | None |
Always present | — |
cloud_watch_logs_role_arn |
str | None |
Always present | — |
kms_key_id |
str | None |
Always present | — |
is_organization_trail |
bool | None |
Always present | — |
recursive_logging |
bool | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
No generated paginator for this operation.
No output stream.
Errors
Import from rboto_cloudtrail.exceptions:
CloudTrailARNInvalidError, CloudTrailAccessNotEnabledError, CloudTrailInvalidClientTokenIdError, CloudWatchLogsDeliveryUnavailableError, ConflictError, InsufficientDependencyServiceAccessPermissionError, InsufficientEncryptionPolicyError, InsufficientS3BucketPolicyError, InsufficientSnsTopicPolicyError, InvalidCloudWatchLogsLogGroupArnError, InvalidCloudWatchLogsRoleArnError, InvalidEventSelectorsError, InvalidHomeRegionError, InvalidKmsKeyIdError, InvalidParameterCombinationError, InvalidParameterError, InvalidS3BucketNameError, InvalidS3PrefixError, InvalidSnsTopicNameError, InvalidTrailNameError, KmsError, KmsKeyDisabledError, KmsKeyNotFoundError, NoManagementAccountSLRExistsError, NotOrganizationMasterAccountError, OperationNotPermittedError, OrganizationNotInAllFeaturesModeError, OrganizationsNotInUseError, S3BucketDoesNotExistError, ThrottlingError, TrailNotFoundError, TrailNotProvidedError, UnsupportedOperationError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.