Skip to content

CloudTrail  >  Operations  >  start_import

start_import

Operation

start_import async

start_import(input: StartImportInput, plugins: list[Plugin] | None = None) -> StartImportOutput

Starts an import of logged trail events from a source S3 bucket to a destination event data store. By default, CloudTrail only imports events contained in the S3 bucket's CloudTrail prefix and the prefixes inside the CloudTrail prefix, and does not check prefixes for other Amazon Web Services services. If you want to import CloudTrail events contained in another prefix, you must include the prefix in the S3LocationUri. For more considerations about importing trail events, see Considerations for copying trail events in the CloudTrail User Guide.

When you start a new import, the Destinations and ImportSource parameters are required. Before starting a new import, disable any access control lists (ACLs) attached to the source S3 bucket. For more information about disabling ACLs, see Controlling ownership of objects and disabling ACLs for your bucket.

When you retry an import, the ImportID parameter is required.

Note

If the destination event data store is for an organization, you must use the management account to import trail events. You cannot use the delegated administrator account for the organization.

Parameters:

Name Type Description Default
input StartImportInput

An instance of StartImportInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
StartImportOutput

An instance of StartImportOutput.

Input

StartImportInput dataclass

Dataclass for StartImportInput structure.

Attributes

destinations class-attribute instance-attribute
destinations: list[str] | None = None

The ARN of the destination event data store. Use this parameter for a new import.

end_event_time class-attribute instance-attribute
end_event_time: datetime | None = None

Use with StartEventTime to bound a StartImport request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified StartEventTime and EndEventTime before attempting to import events.

import_id class-attribute instance-attribute
import_id: str | None = None

The ID of the import. Use this parameter when you are retrying an import.

import_source class-attribute instance-attribute
import_source: ImportSource | None = None

The source S3 bucket for the import. Use this parameter for a new import.

start_event_time class-attribute instance-attribute
start_event_time: datetime | None = None

Use with EndEventTime to bound a StartImport request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified StartEventTime and EndEventTime before attempting to import events.

Output

StartImportOutput dataclass

Dataclass for StartImportOutput structure.

Attributes

created_timestamp class-attribute instance-attribute
created_timestamp: datetime | None = None

The timestamp for the import's creation.

destinations class-attribute instance-attribute
destinations: list[str] | None = None

The ARN of the destination event data store.

end_event_time class-attribute instance-attribute
end_event_time: datetime | None = None

Used with StartEventTime to bound a StartImport request, and limit imported trail events to only those events logged within a specified time period.

import_id class-attribute instance-attribute
import_id: str | None = None

The ID of the import.

import_source class-attribute instance-attribute
import_source: ImportSource | None = None

The source S3 bucket for the import.

import_status class-attribute instance-attribute
import_status: ImportStatus | None = None

Shows the status of the import after a StartImport request. An import finishes with a status of COMPLETED if there were no failures, or FAILED if there were failures.

start_event_time class-attribute instance-attribute
start_event_time: datetime | None = None

Used with EndEventTime to bound a StartImport request, and limit imported trail events to only those events logged within a specified time period.

updated_timestamp class-attribute instance-attribute
updated_timestamp: datetime | None = None

The timestamp of the import's last update, if applicable.