create_event_data_store
¶
create_event_data_store(
name: EventDataStoreName,
*,
config_overrides: Optional[CloudTrailClientConfig] = None,
advanced_event_selectors: Optional[AdvancedEventSelectors] = None,
multi_region_enabled: Optional[Boolean] = None,
organization_enabled: Optional[Boolean] = None,
retention_period: Optional[RetentionPeriod] = None,
termination_protection_enabled: Optional[TerminationProtectionEnabled] = None,
tags_list: Optional[TagsList] = None,
kms_key_id: Optional[EventDataStoreKmsKeyId] = None,
start_ingestion: Optional[Boolean] = None,
billing_mode: Optional[BillingMode] = None,
) -> CreateEventDataStoreResponse
CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.
Creates a new event data store.
Parameters:
-
name(EventDataStoreName) –The name of the event data store.
-
advanced_event_selectors(Optional[AdvancedEventSelectors], default:None) –The advanced event selectors to use to select the events for the data store. You can configure up to five advanced event selectors for each event data store.
For more information about how to use advanced event selectors to log CloudTrail events, see Log events by using advanced event selectors in the CloudTrail User Guide.
For more information about how to use advanced event selectors to include Config configuration items in your event data store, see Create an event data store for Config configuration items in the CloudTrail User Guide.
For more information about how to use advanced event selectors to include events outside of Amazon Web Services events in your event data store, see Create an integration to log events from outside Amazon Web Services in the CloudTrail User Guide.
-
multi_region_enabled(Optional[Boolean], default:None) –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(Optional[Boolean], default:None) –Specifies whether an event data store collects events logged for an organization in Organizations.
-
retention_period(Optional[RetentionPeriod], default:None) –The retention period of the event data store, in days. If
BillingModeis set toEXTENDABLE_RETENTION_PRICING, you can set a retention period of up to 3653 days, the equivalent of 10 years. IfBillingModeis set toFIXED_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
eventTimeof the event is within the specified retention period. For example, if you set a retention period of 90 days, CloudTrail will remove events when theeventTimeis older than 90 days.If you plan to copy trail events to this event data store, we recommend that you consider both the age of the events that you want to copy as well as how long you want to keep the copied events in your event data store. For example, if you copy trail events that are 5 years old and specify a retention period of 7 years, the event data store will retain those events for two years.
-
termination_protection_enabled(Optional[TerminationProtectionEnabled], default:None) –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.
-
kms_key_id(Optional[EventDataStoreKmsKeyId], default:None) –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
-
-
start_ingestion(Optional[Boolean], default:None) –Specifies whether the event data store should start ingesting live events. The default is true.
-
billing_mode(Optional[BillingMode], default:None) –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.
The default value is
EXTENDABLE_RETENTION_PRICING.For more information about CloudTrail pricing, see CloudTrail Pricing and Managing CloudTrail Lake costs.
-
Raises:
-
CloudTrailAccessNotEnabledException–This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see How to enable or disable trusted access in the Organizations User Guide and Prepare For Creating a Trail For Your Organization in the CloudTrail User Guide.
-
ConflictException–This exception is thrown when the specified resource is not ready for an operation. This can occur when you try to run an operation on a resource before CloudTrail has time to fully load the resource, or because another operation is modifying the resource. If this exception occurs, wait a few minutes, and then try the operation again.
-
EventDataStoreAlreadyExistsException–An event data store with that name already exists.
-
EventDataStoreMaxLimitExceededException–Your account has used the maximum number of event data stores.
-
InsufficientDependencyServiceAccessPermissionException–This exception is thrown when the IAM identity that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
-
InsufficientEncryptionPolicyException–For the
CreateTrailPutInsightSelectors,UpdateTrail,StartQuery, andStartImportoperations, this exception is thrown when the policy on the S3 bucket or KMS key does not have sufficient permissions for the operation.For all other operations, this exception is thrown when the policy for the KMS key does not have sufficient permissions for the operation.
-
InvalidEventSelectorsException–This exception is thrown when the
PutEventSelectorsoperation is called with a number of event selectors, advanced event selectors, or data resources that is not valid. The combination of event selectors or advanced event selectors and data resources is not valid. A trail can have up to 5 event selectors. If a trail uses advanced event selectors, a maximum of 500 total values for all conditions in all advanced event selectors is allowed. A trail is limited to 250 data resources. These data resources can be distributed across event selectors, but the overall total cannot exceed 250.You can:
-
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. The limit of number of resources on an individual event selector is configurable up to 250. However, this upper limit is allowed only if the total number of data resources does not exceed 250 across all event selectors for a trail.
-
Specify up to 500 values for all conditions in all advanced event selectors for a trail.
-
Specify a valid value for a parameter. For example, specifying the
ReadWriteTypeparameter with a value ofread-onlyis not valid.
-
-
InvalidKmsKeyIdException–This exception is thrown when the KMS key ARN is not valid.
-
InvalidParameterException–The request includes a parameter that is not valid.
-
InvalidTagParameterException–This exception is thrown when the specified tag key or values are not valid. It can also occur if there are duplicate tags or too many tags on the resource.
-
KmsException–This exception is thrown when there is an issue with the specified KMS key and the trail or event data store can't be updated.
-
KmsKeyNotFoundException–This exception is thrown when the KMS key does not exist, when the S3 bucket and the KMS key are not in the same Region, or when the KMS key associated with the Amazon SNS topic either does not exist or is not in the same Region.
-
NoManagementAccountSLRExistsException–This exception is thrown when the management account does not have a service-linked role.
-
NotOrganizationMasterAccountException–This exception is thrown when the Amazon Web Services account making the request to create or update an organization trail or event data store is not the management account for an organization in Organizations. For more information, see Prepare For Creating a Trail For Your Organization or Organization event data stores.
-
OperationNotPermittedException–This exception is thrown when the requested operation is not permitted.
-
OrganizationNotInAllFeaturesModeException–This exception is thrown when Organizations is not configured to support all features. All features must be enabled in Organizations to support creating an organization trail or event data store.
-
OrganizationsNotInUseException–This exception is thrown when the request is made from an Amazon Web Services account that is not a member of an organization. To make this request, sign in using the credentials of an account that belongs to an organization.
-
ThrottlingException–This exception is thrown when the request rate exceeds the limit.
-
UnsupportedOperationException–This exception is thrown when the requested operation is not supported.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudtrail/_services/cloud_trail.py
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 | |