AWS CloudTrail 2013-11-01
- Client: Aws\CloudTrail\CloudTrailClient
- Service ID: cloudtrail
- Version: 2013-11-01
This page describes the parameters and results for the operations of the AWS CloudTrail (2013-11-01), and shows how to use the Aws\CloudTrail\CloudTrailClient object to call the described operations. This documentation is specific to the 2013-11-01 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- AddTags ( array $params = [] )
Adds one or more tags to a trail or event data store, up to a limit of 50.
- CancelQuery ( array $params = [] )
Cancels a query if the query is not in a terminated state, such as CANCELLED, FAILED, TIMED_OUT, or FINISHED.
- CreateEventDataStore ( array $params = [] )
Creates a new event data store.
- CreateTrail ( array $params = [] )
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
- DeleteEventDataStore ( array $params = [] )
Disables the event data store specified by EventDataStore, which accepts an event data store ARN.
- DeleteTrail ( array $params = [] )
Deletes a trail.
- DescribeQuery ( array $params = [] )
Returns metadata about a query, including query run time in milliseconds, number of events scanned and matched, and query status.
- DescribeTrails ( array $params = [] )
Retrieves settings for one or more trails associated with the current region for your account.
- GetEventDataStore ( array $params = [] )
Returns information about an event data store specified as either an ARN or the ID portion of the ARN.
- GetEventSelectors ( array $params = [] )
Describes the settings for the event selectors that you configured for your trail.
- GetInsightSelectors ( array $params = [] )
Describes the settings for the Insights event selectors that you configured for your trail.
- GetQueryResults ( array $params = [] )
Gets event data results of a query.
- GetTrail ( array $params = [] )
Returns settings information for a specified trail.
- GetTrailStatus ( array $params = [] )
Returns a JSON-formatted list of information about the specified trail.
- ListEventDataStores ( array $params = [] )
Returns information about all event data stores in the account, in the current region.
- ListPublicKeys ( array $params = [] )
Returns all public keys whose private keys were used to sign the digest files within the specified time range.
- ListQueries ( array $params = [] )
Returns a list of queries and query statuses for the past seven days.
- ListTags ( array $params = [] )
Lists the tags for the trail or event data store in the current region.
- ListTrails ( array $params = [] )
Lists trails that are in the current account.
- LookupEvents ( array $params = [] )
Looks up management events or CloudTrail Insights events that are captured by CloudTrail.
- PutEventSelectors ( array $params = [] )
Configures an event selector or advanced event selectors for your trail.
- PutInsightSelectors ( array $params = [] )
Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail.
- RemoveTags ( array $params = [] )
Removes the specified tags from a trail or event data store.
- RestoreEventDataStore ( array $params = [] )
Restores a deleted event data store specified by EventDataStore, which accepts an event data store ARN.
- StartLogging ( array $params = [] )
Starts the recording of Amazon Web Services API calls and log file delivery for a trail.
- StartQuery ( array $params = [] )
Starts a CloudTrail Lake query.
- StopLogging ( array $params = [] )
Suspends the recording of Amazon Web Services API calls and log file delivery for the specified trail.
- UpdateEventDataStore ( array $params = [] )
Updates an event data store.
- UpdateTrail ( array $params = [] )
Updates trail settings that control what events you are logging, and how to handle log files.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
AddTags
$result = $client->addTags
([/* ... */]); $promise = $client->addTagsAsync
([/* ... */]);
Adds one or more tags to a trail or event data store, up to a limit of 50. Overwrites an existing tag's value when a new value is specified for an existing tag key. Tag key names must be unique for a trail; you cannot have two keys with the same name but different values. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail or event data store that applies to all Amazon Web Services Regions only from the Region in which the trail or event data store was created (also known as its home region).
Parameter Syntax
$result = $client->addTags([ 'ResourceId' => '<string>', // REQUIRED 'TagsList' => [ // REQUIRED [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', ], // ... ], ]);
Parameter Details
Members
- ResourceId
-
- Required: Yes
- Type: string
Specifies the ARN of the trail or event data store 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
- TagsList
-
- Required: Yes
- Type: Array of Tag structures
Contains a list of tags, up to a limit of 50
Result Syntax
[]
Result Details
Errors
-
This exception is thrown when the specified resource is not found.
-
CloudTrailARNInvalidException:
This exception is thrown when an operation is called with a trail ARN that is not valid. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
-
ResourceTypeNotSupportedException:
This exception is thrown when the specified resource type is not supported by CloudTrail.
-
The number of tags per trail has exceeded the permitted amount. Currently, the limit is 50.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
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.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
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 Create an event data store.
-
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. If this exception occurs, wait a few minutes, and then try the operation again.
CancelQuery
$result = $client->cancelQuery
([/* ... */]); $promise = $client->cancelQueryAsync
([/* ... */]);
Cancels a query if the query is not in a terminated state, such as CANCELLED
, FAILED
, TIMED_OUT
, or FINISHED
. You must specify an ARN value for EventDataStore
. The ID of the query that you want to cancel is also required. When you run CancelQuery
, the query status might show as CANCELLED
even if the operation is not yet finished.
Parameter Syntax
$result = $client->cancelQuery([ 'EventDataStore' => '<string>', // REQUIRED 'QueryId' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'QueryId' => '<string>', 'QueryStatus' => 'QUEUED|RUNNING|FINISHED|FAILED|CANCELLED|TIMED_OUT', ]
Result Details
Members
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
The specified query cannot be canceled because it is in the
FINISHED
,FAILED
,TIMED_OUT
, orCANCELLED
state. -
The request includes a parameter that is not valid.
-
The query ID does not exist or does not map to a query.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
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. If this exception occurs, wait a few minutes, and then try the operation again.
CreateEventDataStore
$result = $client->createEventDataStore
([/* ... */]); $promise = $client->createEventDataStoreAsync
([/* ... */]);
Creates a new event data store.
Parameter Syntax
$result = $client->createEventDataStore([ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ // REQUIRED [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', // REQUIRED 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'MultiRegionEnabled' => true || false, 'Name' => '<string>', // REQUIRED 'OrganizationEnabled' => true || false, 'RetentionPeriod' => <integer>, 'TagsList' => [ [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', ], // ... ], 'TerminationProtectionEnabled' => true || false, ]);
Parameter Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
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.
- MultiRegionEnabled
-
- Type: boolean
Specifies whether the event data store includes events from all regions, or only from the region in which the event data store is created.
- Name
-
- Required: Yes
- Type: string
The name of the event data store.
- OrganizationEnabled
-
- Type: boolean
Specifies whether an event data store collects events logged for an organization in Organizations.
- RetentionPeriod
-
- Type: int
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.
- TagsList
-
- Type: Array of Tag structures
A list of tags.
- TerminationProtectionEnabled
-
- Type: boolean
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.
Result Syntax
[ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'CreatedTimestamp' => <DateTime>, 'EventDataStoreArn' => '<string>', 'MultiRegionEnabled' => true || false, 'Name' => '<string>', 'OrganizationEnabled' => true || false, 'RetentionPeriod' => <integer>, 'Status' => 'CREATED|ENABLED|PENDING_DELETION', 'TagsList' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], 'TerminationProtectionEnabled' => true || false, 'UpdatedTimestamp' => <DateTime>, ]
Result Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
The advanced event selectors that were used to select the events for the data store.
- CreatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The timestamp that shows when the event data store was created.
- EventDataStoreArn
-
- Type: string
The ARN of the event data store.
- MultiRegionEnabled
-
- Type: boolean
Indicates whether the event data store collects events from all regions, or only from the region in which it was created.
- Name
-
- Type: string
The name of the event data store.
- OrganizationEnabled
-
- Type: boolean
Indicates whether an event data store is collecting logged events for an organization in Organizations.
- RetentionPeriod
-
- Type: int
The retention period of an event data store, in days.
- Status
-
- Type: string
The status of event data store creation.
- TagsList
-
- Type: Array of Tag structures
A list of tags.
- TerminationProtectionEnabled
-
- Type: boolean
Indicates whether termination protection is enabled for the event data store.
- UpdatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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
.
Errors
-
EventDataStoreAlreadyExistsException:
An event data store with that name already exists.
-
EventDataStoreMaxLimitExceededException:
Your account has used the maximum number of event data stores.
-
The request includes a parameter that is not valid.
-
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.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
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. If this exception occurs, wait a few minutes, and then try the operation again.
-
CloudTrailAccessNotEnabledException:
This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see Enabling Trusted Access with Other Amazon Web Services Services and Prepare For Creating a Trail For Your Organization.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
-
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 Create an 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.
-
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.
CreateTrail
$result = $client->createTrail
([/* ... */]); $promise = $client->createTrailAsync
([/* ... */]);
Creates a trail that specifies the settings for delivery of log data to an Amazon S3 bucket.
Parameter Syntax
$result = $client->createTrail([ 'CloudWatchLogsLogGroupArn' => '<string>', 'CloudWatchLogsRoleArn' => '<string>', 'EnableLogFileValidation' => true || false, 'IncludeGlobalServiceEvents' => true || false, 'IsMultiRegionTrail' => true || false, 'IsOrganizationTrail' => true || false, 'KmsKeyId' => '<string>', 'Name' => '<string>', // REQUIRED 'S3BucketName' => '<string>', // REQUIRED 'S3KeyPrefix' => '<string>', 'SnsTopicName' => '<string>', 'TagsList' => [ [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', ], // ... ], ]);
Parameter Details
Members
- CloudWatchLogsLogGroupArn
-
- Type: 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
. - CloudWatchLogsRoleArn
-
- Type: string
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
- EnableLogFileValidation
-
- Type: boolean
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.
- IncludeGlobalServiceEvents
-
- Type: boolean
Specifies whether the trail is publishing events from global services such as IAM to the log files.
- IsMultiRegionTrail
-
- Type: boolean
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.
- IsOrganizationTrail
-
- Type: boolean
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.
- KmsKeyId
-
- Type: 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
- Name
-
- Required: Yes
- Type: 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)
- S3BucketName
-
- Required: Yes
- Type: string
Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.
- S3KeyPrefix
-
- Type: 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.
- SnsTopicName
-
- Type: string
Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
- TagsList
-
- Type: Array of Tag structures
A list of tags.
Result Syntax
[ 'CloudWatchLogsLogGroupArn' => '<string>', 'CloudWatchLogsRoleArn' => '<string>', 'IncludeGlobalServiceEvents' => true || false, 'IsMultiRegionTrail' => true || false, 'IsOrganizationTrail' => true || false, 'KmsKeyId' => '<string>', 'LogFileValidationEnabled' => true || false, 'Name' => '<string>', 'S3BucketName' => '<string>', 'S3KeyPrefix' => '<string>', 'SnsTopicARN' => '<string>', 'SnsTopicName' => '<string>', 'TrailARN' => '<string>', ]
Result Details
Members
- CloudWatchLogsLogGroupArn
-
- Type: string
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs will be delivered.
- CloudWatchLogsRoleArn
-
- Type: string
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
- IncludeGlobalServiceEvents
-
- Type: boolean
Specifies whether the trail is publishing events from global services such as IAM to the log files.
- IsMultiRegionTrail
-
- Type: boolean
Specifies whether the trail exists in one region or in all regions.
- IsOrganizationTrail
-
- Type: boolean
Specifies whether the trail is an organization trail.
- KmsKeyId
-
- Type: 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
- LogFileValidationEnabled
-
- Type: boolean
Specifies whether log file integrity validation is enabled.
- Name
-
- Type: string
Specifies the name of the trail.
- S3BucketName
-
- Type: string
Specifies the name of the Amazon S3 bucket designated for publishing log files.
- S3KeyPrefix
-
- Type: 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.
- SnsTopicARN
-
- Type: 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
- SnsTopicName
-
- Type: string
This field is no longer in use. Use SnsTopicARN.
- TrailARN
-
- Type: 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
Errors
-
MaximumNumberOfTrailsExceededException:
This exception is thrown when the maximum number of trails is reached.
-
This exception is thrown when the specified trail already exists.
-
S3BucketDoesNotExistException:
This exception is thrown when the specified S3 bucket does not exist.
-
InsufficientS3BucketPolicyException:
This exception is thrown when the policy on the S3 bucket is not sufficient.
-
InsufficientSnsTopicPolicyException:
This exception is thrown when the policy on the Amazon SNS topic is not sufficient.
-
InsufficientEncryptionPolicyException:
This exception is thrown when the policy on the S3 bucket or KMS key is not sufficient.
-
This exception is thrown when the provided S3 bucket name is not valid.
-
This exception is thrown when the provided S3 prefix is not valid.
-
This exception is thrown when the provided SNS topic name is not valid.
-
This exception is thrown when the KMS key ARN is not valid.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
This exception is no longer in use.
-
InvalidParameterCombinationException:
This exception is thrown when the combination of parameters provided is not valid.
-
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.
-
This exception is no longer in use.
-
This exception is thrown when there is an issue with the specified KMS key and the trail can’t be updated.
-
InvalidCloudWatchLogsLogGroupArnException:
This exception is thrown when the provided CloudWatch Logs log group is not valid.
-
InvalidCloudWatchLogsRoleArnException:
This exception is thrown when the provided role is not valid.
-
CloudWatchLogsDeliveryUnavailableException:
Cannot set a CloudWatch Logs delivery for this region.
-
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.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
CloudTrailAccessNotEnabledException:
This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see Enabling Trusted Access with Other Amazon Web Services Services and Prepare For Creating a Trail For Your Organization.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
-
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 Create an 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.
-
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.
-
CloudTrailInvalidClientTokenIdException:
This exception is thrown when a call results in the
InvalidClientTokenId
error code. This can occur when you are creating or updating a trail to send notifications to an Amazon SNS topic that is in a suspended Amazon Web Services account. -
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. If this exception occurs, wait a few minutes, and then try the operation again.
DeleteEventDataStore
$result = $client->deleteEventDataStore
([/* ... */]); $promise = $client->deleteEventDataStoreAsync
([/* ... */]);
Disables the event data store specified by EventDataStore
, which accepts an event data store ARN. After you run DeleteEventDataStore
, the event data store enters a PENDING_DELETION
state, and is automatically deleted after a wait period of seven days. TerminationProtectionEnabled
must be set to False
on the event data store; this operation cannot work if TerminationProtectionEnabled
is True
.
After you run DeleteEventDataStore
on an event data store, you cannot run ListQueries
, DescribeQuery
, or GetQueryResults
on queries that are using an event data store in a PENDING_DELETION
state. An event data store in the PENDING_DELETION
state does not incur costs.
Parameter Syntax
$result = $client->deleteEventDataStore([ 'EventDataStore' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
EventDataStoreTerminationProtectedException:
The event data store cannot be deleted because termination protection is enabled for it.
-
The request includes a parameter that is not valid.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
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 Create an event data store.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
DeleteTrail
$result = $client->deleteTrail
([/* ... */]); $promise = $client->deleteTrailAsync
([/* ... */]);
Deletes a trail. This operation must be called from the region in which the trail was created. DeleteTrail
cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
Parameter Syntax
$result = $client->deleteTrail([ 'Name' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
This exception is thrown when an operation is called on a trail from a region other than the region in which the trail was created.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
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 Create an event data store.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
-
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. If this exception occurs, wait a few minutes, and then try the operation again.
DescribeQuery
$result = $client->describeQuery
([/* ... */]); $promise = $client->describeQueryAsync
([/* ... */]);
Returns metadata about a query, including query run time in milliseconds, number of events scanned and matched, and query status. You must specify an ARN for EventDataStore
, and a value for QueryID
.
Parameter Syntax
$result = $client->describeQuery([ 'EventDataStore' => '<string>', // REQUIRED 'QueryId' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'ErrorMessage' => '<string>', 'QueryId' => '<string>', 'QueryStatistics' => [ 'BytesScanned' => <integer>, 'CreationTime' => <DateTime>, 'EventsMatched' => <integer>, 'EventsScanned' => <integer>, 'ExecutionTimeInMillis' => <integer>, ], 'QueryStatus' => 'QUEUED|RUNNING|FINISHED|FAILED|CANCELLED|TIMED_OUT', 'QueryString' => '<string>', ]
Result Details
Members
- ErrorMessage
-
- Type: string
The error message returned if a query failed.
- QueryId
-
- Type: string
The ID of the query.
- QueryStatistics
-
- Type: QueryStatisticsForDescribeQuery structure
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.
- QueryStatus
-
- Type: string
The status of a query. Values for
QueryStatus
includeQUEUED
,RUNNING
,FINISHED
,FAILED
,TIMED_OUT
, orCANCELLED
- QueryString
-
- Type: string
The SQL code of a query.
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
The request includes a parameter that is not valid.
-
The query ID does not exist or does not map to a query.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
DescribeTrails
$result = $client->describeTrails
([/* ... */]); $promise = $client->describeTrailsAsync
([/* ... */]);
Retrieves settings for one or more trails associated with the current region for your account.
Parameter Syntax
$result = $client->describeTrails([ 'includeShadowTrails' => true || false, 'trailNameList' => ['<string>', ...], ]);
Parameter Details
Members
- includeShadowTrails
-
- Type: boolean
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.
- trailNameList
-
- Type: Array of strings
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.
Result Syntax
[ 'trailList' => [ [ 'CloudWatchLogsLogGroupArn' => '<string>', 'CloudWatchLogsRoleArn' => '<string>', 'HasCustomEventSelectors' => true || false, 'HasInsightSelectors' => true || false, 'HomeRegion' => '<string>', 'IncludeGlobalServiceEvents' => true || false, 'IsMultiRegionTrail' => true || false, 'IsOrganizationTrail' => true || false, 'KmsKeyId' => '<string>', 'LogFileValidationEnabled' => true || false, 'Name' => '<string>', 'S3BucketName' => '<string>', 'S3KeyPrefix' => '<string>', 'SnsTopicARN' => '<string>', 'SnsTopicName' => '<string>', 'TrailARN' => '<string>', ], // ... ], ]
Result Details
Members
- trailList
-
- Type: Array of Trail structures
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.
Errors
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
GetEventDataStore
$result = $client->getEventDataStore
([/* ... */]); $promise = $client->getEventDataStoreAsync
([/* ... */]);
Returns information about an event data store specified as either an ARN or the ID portion of the ARN.
Parameter Syntax
$result = $client->getEventDataStore([ 'EventDataStore' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'CreatedTimestamp' => <DateTime>, 'EventDataStoreArn' => '<string>', 'MultiRegionEnabled' => true || false, 'Name' => '<string>', 'OrganizationEnabled' => true || false, 'RetentionPeriod' => <integer>, 'Status' => 'CREATED|ENABLED|PENDING_DELETION', 'TerminationProtectionEnabled' => true || false, 'UpdatedTimestamp' => <DateTime>, ]
Result Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
The advanced event selectors used to select events for the data store.
- CreatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The timestamp of the event data store's creation.
- EventDataStoreArn
-
- Type: string
The event data store Amazon Resource Number (ARN).
- MultiRegionEnabled
-
- Type: boolean
Indicates whether the event data store includes events from all regions, or only from the region in which it was created.
- Name
-
- Type: string
The name of the event data store.
- OrganizationEnabled
-
- Type: boolean
Indicates whether an event data store is collecting logged events for an organization in Organizations.
- RetentionPeriod
-
- Type: int
The retention period of the event data store, in days.
- Status
-
- Type: string
The status of an event data store. Values can be
ENABLED
andPENDING_DELETION
. - TerminationProtectionEnabled
-
- Type: boolean
Indicates that termination protection is enabled.
- UpdatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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
.
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
The request includes a parameter that is not valid.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
GetEventSelectors
$result = $client->getEventSelectors
([/* ... */]); $promise = $client->getEventSelectorsAsync
([/* ... */]);
Describes the settings for the event selectors that you configured for your trail. The information returned for your event selectors includes the following:
-
If your event selector includes read-only events, write-only events, or all events. This applies to both management events and data events.
-
If your event selector includes management events.
-
If your event selector includes data events, the resources on which you are logging data events.
For more information, see Logging Data and Management Events for Trails in the CloudTrail User Guide.
Parameter Syntax
$result = $client->getEventSelectors([ 'TrailName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- TrailName
-
- Required: Yes
- Type: 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
Result Syntax
[ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'EventSelectors' => [ [ 'DataResources' => [ [ 'Type' => '<string>', 'Values' => ['<string>', ...], ], // ... ], 'ExcludeManagementEventSources' => ['<string>', ...], 'IncludeManagementEvents' => true || false, 'ReadWriteType' => 'ReadOnly|WriteOnly|All', ], // ... ], 'TrailARN' => '<string>', ]
Result Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
The advanced event selectors that are configured for the trail.
- EventSelectors
-
- Type: Array of EventSelector structures
The event selectors that are configured for the trail.
- TrailARN
-
- Type: string
The specified trail ARN that has the event selectors.
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
GetInsightSelectors
$result = $client->getInsightSelectors
([/* ... */]); $promise = $client->getInsightSelectorsAsync
([/* ... */]);
Describes the settings for the Insights event selectors that you configured for your trail. GetInsightSelectors
shows if CloudTrail Insights event logging is enabled on the trail, and if it is, which insight types are enabled. If you run GetInsightSelectors
on a trail that does not have Insights events enabled, the operation throws the exception InsightNotEnabledException
For more information, see Logging CloudTrail Insights Events for Trails in the CloudTrail User Guide.
Parameter Syntax
$result = $client->getInsightSelectors([ 'TrailName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- TrailName
-
- Required: Yes
- Type: 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
Result Syntax
[ 'InsightSelectors' => [ [ 'InsightType' => 'ApiCallRateInsight|ApiErrorRateInsight', ], // ... ], 'TrailARN' => '<string>', ]
Result Details
Members
- InsightSelectors
-
- Type: Array of InsightSelector structures
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. - TrailARN
-
- Type: string
The Amazon Resource Name (ARN) of a trail for which you want to get Insights selectors.
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
If you run
GetInsightSelectors
on a trail that does not have Insights events enabled, the operation throws the exceptionInsightNotEnabledException
.
GetQueryResults
$result = $client->getQueryResults
([/* ... */]); $promise = $client->getQueryResultsAsync
([/* ... */]);
Gets event data results of a query. You must specify the QueryID
value returned by the StartQuery
operation, and an ARN for EventDataStore
.
Parameter Syntax
$result = $client->getQueryResults([ 'EventDataStore' => '<string>', // REQUIRED 'MaxQueryResults' => <integer>, 'NextToken' => '<string>', 'QueryId' => '<string>', // REQUIRED ]);
Parameter Details
Members
- EventDataStore
-
- Required: Yes
- Type: string
The ARN (or ID suffix of the ARN) of the event data store against which the query was run.
- MaxQueryResults
-
- Type: int
The maximum number of query results to display on a single page.
- NextToken
-
- Type: string
A token you can use to get the next page of query results.
- QueryId
-
- Required: Yes
- Type: string
The ID of the query for which you want to get results.
Result Syntax
[ 'ErrorMessage' => '<string>', 'NextToken' => '<string>', 'QueryResultRows' => [ [ ['<string>', ...], // ... ], // ... ], 'QueryStatistics' => [ 'BytesScanned' => <integer>, 'ResultsCount' => <integer>, 'TotalResultsCount' => <integer>, ], 'QueryStatus' => 'QUEUED|RUNNING|FINISHED|FAILED|CANCELLED|TIMED_OUT', ]
Result Details
Members
- ErrorMessage
-
- Type: string
The error message returned if a query failed.
- NextToken
-
- Type: string
A token you can use to get the next page of query results.
- QueryResultRows
-
- Type: Array of lists
Contains the individual event results of the query.
- QueryStatistics
-
- Type: QueryStatistics structure
Shows the count of query results.
- QueryStatus
-
- Type: string
The status of the query. Values include
QUEUED
,RUNNING
,FINISHED
,FAILED
,TIMED_OUT
, orCANCELLED
.
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
This exception is thrown if the limit specified is not valid.
-
A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.
-
The request includes a parameter that is not valid.
-
The query ID does not exist or does not map to a query.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
GetTrail
$result = $client->getTrail
([/* ... */]); $promise = $client->getTrailAsync
([/* ... */]);
Returns settings information for a specified trail.
Parameter Syntax
$result = $client->getTrail([ 'Name' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Trail' => [ 'CloudWatchLogsLogGroupArn' => '<string>', 'CloudWatchLogsRoleArn' => '<string>', 'HasCustomEventSelectors' => true || false, 'HasInsightSelectors' => true || false, 'HomeRegion' => '<string>', 'IncludeGlobalServiceEvents' => true || false, 'IsMultiRegionTrail' => true || false, 'IsOrganizationTrail' => true || false, 'KmsKeyId' => '<string>', 'LogFileValidationEnabled' => true || false, 'Name' => '<string>', 'S3BucketName' => '<string>', 'S3KeyPrefix' => '<string>', 'SnsTopicARN' => '<string>', 'SnsTopicName' => '<string>', 'TrailARN' => '<string>', ], ]
Result Details
Members
- Trail
-
- Type: Trail structure
The settings for a trail.
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
GetTrailStatus
$result = $client->getTrailStatus
([/* ... */]); $promise = $client->getTrailStatusAsync
([/* ... */]);
Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.
Parameter Syntax
$result = $client->getTrailStatus([ 'Name' => '<string>', // REQUIRED ]);
Parameter Details
Members
- Name
-
- Required: Yes
- Type: 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
Result Syntax
[ 'IsLogging' => true || false, 'LatestCloudWatchLogsDeliveryError' => '<string>', 'LatestCloudWatchLogsDeliveryTime' => <DateTime>, 'LatestDeliveryAttemptSucceeded' => '<string>', 'LatestDeliveryAttemptTime' => '<string>', 'LatestDeliveryError' => '<string>', 'LatestDeliveryTime' => <DateTime>, 'LatestDigestDeliveryError' => '<string>', 'LatestDigestDeliveryTime' => <DateTime>, 'LatestNotificationAttemptSucceeded' => '<string>', 'LatestNotificationAttemptTime' => '<string>', 'LatestNotificationError' => '<string>', 'LatestNotificationTime' => <DateTime>, 'StartLoggingTime' => <DateTime>, 'StopLoggingTime' => <DateTime>, 'TimeLoggingStarted' => '<string>', 'TimeLoggingStopped' => '<string>', ]
Result Details
Members
- IsLogging
-
- Type: boolean
Whether the CloudTrail trail is currently logging Amazon Web Services API calls.
- LatestCloudWatchLogsDeliveryError
-
- Type: string
Displays any CloudWatch Logs error that CloudTrail encountered when attempting to deliver logs to CloudWatch Logs.
- LatestCloudWatchLogsDeliveryTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Displays the most recent date and time when CloudTrail delivered logs to CloudWatch Logs.
- LatestDeliveryAttemptSucceeded
-
- Type: string
This field is no longer in use.
- LatestDeliveryAttemptTime
-
- Type: string
This field is no longer in use.
- LatestDeliveryError
-
- Type: 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. - LatestDeliveryTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Specifies the date and time that CloudTrail last delivered log files to an account's Amazon S3 bucket.
- LatestDigestDeliveryError
-
- Type: 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. - LatestDigestDeliveryTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Specifies the date and time that CloudTrail last delivered a digest file to an account's Amazon S3 bucket.
- LatestNotificationAttemptSucceeded
-
- Type: string
This field is no longer in use.
- LatestNotificationAttemptTime
-
- Type: string
This field is no longer in use.
- LatestNotificationError
-
- Type: 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.
- LatestNotificationTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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.
- StartLoggingTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Specifies the most recent date and time when CloudTrail started recording API calls for an Amazon Web Services account.
- StopLoggingTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Specifies the most recent date and time when CloudTrail stopped recording API calls for an Amazon Web Services account.
- TimeLoggingStarted
-
- Type: string
This field is no longer in use.
- TimeLoggingStopped
-
- Type: string
This field is no longer in use.
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
ListEventDataStores
$result = $client->listEventDataStores
([/* ... */]); $promise = $client->listEventDataStoresAsync
([/* ... */]);
Returns information about all event data stores in the account, in the current region.
Parameter Syntax
$result = $client->listEventDataStores([ 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
Result Syntax
[ 'EventDataStores' => [ [ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'CreatedTimestamp' => <DateTime>, 'EventDataStoreArn' => '<string>', 'MultiRegionEnabled' => true || false, 'Name' => '<string>', 'OrganizationEnabled' => true || false, 'RetentionPeriod' => <integer>, 'Status' => 'CREATED|ENABLED|PENDING_DELETION', 'TerminationProtectionEnabled' => true || false, 'UpdatedTimestamp' => <DateTime>, ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- EventDataStores
-
- Type: Array of EventDataStore structures
Contains information about event data stores in the account, in the current region.
- NextToken
-
- Type: string
A token you can use to get the next page of results.
Errors
-
This exception is thrown if the limit specified is not valid.
-
A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
ListPublicKeys
$result = $client->listPublicKeys
([/* ... */]); $promise = $client->listPublicKeysAsync
([/* ... */]);
Returns all public keys whose private keys were used to sign the digest files within the specified time range. The public key is needed to validate digest files that were signed with its corresponding private key.
CloudTrail uses different private and public key pairs per region. Each digest file is signed with a private key unique to its region. When you validate a digest file from a specific region, you must look in the same region for its corresponding public key.
Parameter Syntax
$result = $client->listPublicKeys([ 'EndTime' => <integer || string || DateTime>, 'NextToken' => '<string>', 'StartTime' => <integer || string || DateTime>, ]);
Parameter Details
Members
- EndTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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.
- NextToken
-
- Type: string
Reserved for future use.
- StartTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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.
Result Syntax
[ 'NextToken' => '<string>', 'PublicKeyList' => [ [ 'Fingerprint' => '<string>', 'ValidityEndTime' => <DateTime>, 'ValidityStartTime' => <DateTime>, 'Value' => <string || resource || Psr\Http\Message\StreamInterface>, ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: string
Reserved for future use.
- PublicKeyList
-
- Type: Array of PublicKey structures
Contains an array of PublicKey objects.
The returned public keys may have validity time ranges that overlap.
Errors
-
Occurs if the timestamp values are not valid. Either the start time occurs after the end time, or the time range is outside the range of possible values.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
Reserved for future use.
ListQueries
$result = $client->listQueries
([/* ... */]); $promise = $client->listQueriesAsync
([/* ... */]);
Returns a list of queries and query statuses for the past seven days. You must specify an ARN value for EventDataStore
. Optionally, to shorten the list of results, you can specify a time range, formatted as timestamps, by adding StartTime
and EndTime
parameters, and a QueryStatus
value. Valid values for QueryStatus
include QUEUED
, RUNNING
, FINISHED
, FAILED
, TIMED_OUT
, or CANCELLED
.
Parameter Syntax
$result = $client->listQueries([ 'EndTime' => <integer || string || DateTime>, 'EventDataStore' => '<string>', // REQUIRED 'MaxResults' => <integer>, 'NextToken' => '<string>', 'QueryStatus' => 'QUEUED|RUNNING|FINISHED|FAILED|CANCELLED|TIMED_OUT', 'StartTime' => <integer || string || DateTime>, ]);
Parameter Details
Members
- EndTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Use with
StartTime
to bound aListQueries
request, and limit its results to only those queries run within a specified time period. - EventDataStore
-
- Required: Yes
- Type: string
The ARN (or the ID suffix of the ARN) of an event data store on which queries were run.
- MaxResults
-
- Type: int
The maximum number of queries to show on a page.
- NextToken
-
- Type: string
A token you can use to get the next page of results.
- QueryStatus
-
- Type: string
The status of queries that you want to return in results. Valid values for
QueryStatus
includeQUEUED
,RUNNING
,FINISHED
,FAILED
,TIMED_OUT
, orCANCELLED
. - StartTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
Use with
EndTime
to bound aListQueries
request, and limit its results to only those queries run within a specified time period.
Result Syntax
[ 'NextToken' => '<string>', 'Queries' => [ [ 'CreationTime' => <DateTime>, 'QueryId' => '<string>', 'QueryStatus' => 'QUEUED|RUNNING|FINISHED|FAILED|CANCELLED|TIMED_OUT', ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: string
A token you can use to get the next page of results.
- Queries
-
- Type: Array of Query structures
Lists matching query results, and shows query ID, status, and creation time of each query.
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
A date range for the query was specified that is not valid. Be sure that the start time is chronologically before the end time. For more information about writing a query, see Create or edit a query in the CloudTrail User Guide.
-
This exception is thrown if the limit specified is not valid.
-
A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.
-
The request includes a parameter that is not valid.
-
The query status is not valid for the operation.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
ListTags
$result = $client->listTags
([/* ... */]); $promise = $client->listTagsAsync
([/* ... */]);
Lists the tags for the trail or event data store in the current region.
Parameter Syntax
$result = $client->listTags([ 'NextToken' => '<string>', 'ResourceIdList' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'NextToken' => '<string>', 'ResourceTagList' => [ [ 'ResourceId' => '<string>', 'TagsList' => [ [ 'Key' => '<string>', 'Value' => '<string>', ], // ... ], ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: string
Reserved for future use.
- ResourceTagList
-
- Type: Array of ResourceTag structures
A list of resource tags.
Errors
-
This exception is thrown when the specified resource is not found.
-
CloudTrailARNInvalidException:
This exception is thrown when an operation is called with a trail ARN that is not valid. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
-
ResourceTypeNotSupportedException:
This exception is thrown when the specified resource type is not supported by CloudTrail.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
InactiveEventDataStoreException:
The event data store is inactive.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
Reserved for future use.
ListTrails
$result = $client->listTrails
([/* ... */]); $promise = $client->listTrailsAsync
([/* ... */]);
Lists trails that are in the current account.
Parameter Syntax
$result = $client->listTrails([ 'NextToken' => '<string>', ]);
Parameter Details
Members
- NextToken
-
- Type: 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.
Result Syntax
[ 'NextToken' => '<string>', 'Trails' => [ [ 'HomeRegion' => '<string>', 'Name' => '<string>', 'TrailARN' => '<string>', ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: 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.
- Trails
-
- Type: Array of TrailInfo structures
Returns the name, ARN, and home region of trails in the current account.
Errors
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
LookupEvents
$result = $client->lookupEvents
([/* ... */]); $promise = $client->lookupEventsAsync
([/* ... */]);
Looks up management events or CloudTrail Insights events that are captured by CloudTrail. You can look up events that occurred in a region within the last 90 days. Lookup supports the following attributes for management events:
-
Amazon Web Services access key
-
Event ID
-
Event name
-
Event source
-
Read only
-
Resource name
-
Resource type
-
User name
Lookup supports the following attributes for Insights events:
-
Event ID
-
Event name
-
Event source
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to two per second, per account, per region. If this limit is exceeded, a throttling error occurs.
Parameter Syntax
$result = $client->lookupEvents([ 'EndTime' => <integer || string || DateTime>, 'EventCategory' => 'insight', 'LookupAttributes' => [ [ 'AttributeKey' => 'EventId|EventName|ReadOnly|Username|ResourceType|ResourceName|EventSource|AccessKeyId', // REQUIRED 'AttributeValue' => '<string>', // REQUIRED ], // ... ], 'MaxResults' => <integer>, 'NextToken' => '<string>', 'StartTime' => <integer || string || DateTime>, ]);
Parameter Details
Members
- EndTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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.
- EventCategory
-
- Type: string
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. - LookupAttributes
-
- Type: Array of LookupAttribute structures
Contains a list of lookup attributes. Currently the list can contain only one item.
- MaxResults
-
- Type: int
The number of events to return. Possible values are 1 through 50. The default is 50.
- NextToken
-
- Type: 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.
- StartTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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.
Result Syntax
[ 'Events' => [ [ 'AccessKeyId' => '<string>', 'CloudTrailEvent' => '<string>', 'EventId' => '<string>', 'EventName' => '<string>', 'EventSource' => '<string>', 'EventTime' => <DateTime>, 'ReadOnly' => '<string>', 'Resources' => [ [ 'ResourceName' => '<string>', 'ResourceType' => '<string>', ], // ... ], 'Username' => '<string>', ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- Events
-
- Type: Array of Event structures
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.
- NextToken
-
- Type: 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.
Errors
-
InvalidLookupAttributesException:
Occurs when a lookup attribute is specified that is not valid.
-
Occurs if the timestamp values are not valid. Either the start time occurs after the end time, or the time range is outside the range of possible values.
-
This exception is thrown if the limit specified is not valid.
-
A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.
-
InvalidEventCategoryException:
Occurs if an event category that is not valid is specified as a value of
EventCategory
. -
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
PutEventSelectors
$result = $client->putEventSelectors
([/* ... */]); $promise = $client->putEventSelectorsAsync
([/* ... */]);
Configures an event selector or advanced event selectors for your trail. Use event selectors or advanced event selectors to specify management and data event settings for your trail. By default, trails created without specific event selectors are configured to log all read and write management events, and no data events.
When an event occurs in your account, CloudTrail evaluates the event selectors or advanced event selectors in all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.
Example
-
You create an event selector for a trail and specify that you want write-only events.
-
The EC2
GetConsoleOutput
andRunInstances
API operations occur in your account. -
CloudTrail evaluates whether the events match your event selectors.
-
The
RunInstances
is a write-only event and it matches your event selector. The trail logs the event. -
The
GetConsoleOutput
is a read-only event that doesn't match your event selector. The trail doesn't log the event.
The PutEventSelectors
operation must be called from the region in which the trail was created; otherwise, an InvalidHomeRegionException
exception is thrown.
You can configure up to five event selectors for each trail. For more information, see Logging data and management events for trails and Quotas in CloudTrail in the CloudTrail User Guide.
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 for trails in the CloudTrail User Guide.
Parameter Syntax
$result = $client->putEventSelectors([ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ // REQUIRED [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', // REQUIRED 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'EventSelectors' => [ [ 'DataResources' => [ [ 'Type' => '<string>', 'Values' => ['<string>', ...], ], // ... ], 'ExcludeManagementEventSources' => ['<string>', ...], 'IncludeManagementEvents' => true || false, 'ReadWriteType' => 'ReadOnly|WriteOnly|All', ], // ... ], 'TrailName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
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. - EventSelectors
-
- Type: Array of EventSelector structures
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. - TrailName
-
- Required: Yes
- Type: 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
Result Syntax
[ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'EventSelectors' => [ [ 'DataResources' => [ [ 'Type' => '<string>', 'Values' => ['<string>', ...], ], // ... ], 'ExcludeManagementEventSources' => ['<string>', ...], 'IncludeManagementEvents' => true || false, 'ReadWriteType' => 'ReadOnly|WriteOnly|All', ], // ... ], 'TrailARN' => '<string>', ]
Result Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
Specifies the advanced event selectors configured for your trail.
- EventSelectors
-
- Type: Array of EventSelector structures
Specifies the event selectors configured for your trail.
- TrailARN
-
- Type: 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
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
This exception is thrown when an operation is called on a trail from a region other than the region in which the trail was created.
-
InvalidEventSelectorsException:
This exception is thrown when the
PutEventSelectors
operation 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
ReadWriteType
parameter with a value ofread-only
is not valid.
-
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
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 Create an event data store.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
PutInsightSelectors
$result = $client->putInsightSelectors
([/* ... */]); $promise = $client->putInsightSelectorsAsync
([/* ... */]);
Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail. You also use PutInsightSelectors
to turn off Insights event logging, by passing an empty list of insight types. The valid Insights event types in this release are ApiErrorRateInsight
and ApiCallRateInsight
.
Parameter Syntax
$result = $client->putInsightSelectors([ 'InsightSelectors' => [ // REQUIRED [ 'InsightType' => 'ApiCallRateInsight|ApiErrorRateInsight', ], // ... ], 'TrailName' => '<string>', // REQUIRED ]);
Parameter Details
Members
- InsightSelectors
-
- Required: Yes
- Type: Array of InsightSelector structures
A JSON string that contains the insight types you want to log on a trail.
ApiCallRateInsight
andApiErrorRateInsight
are valid insight types. - TrailName
-
- Required: Yes
- Type: string
The name of the CloudTrail trail for which you want to change or add Insights selectors.
Result Syntax
[ 'InsightSelectors' => [ [ 'InsightType' => 'ApiCallRateInsight|ApiErrorRateInsight', ], // ... ], 'TrailARN' => '<string>', ]
Result Details
Members
- InsightSelectors
-
- Type: Array of InsightSelector structures
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
. - TrailARN
-
- Type: string
The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
This exception is thrown when an operation is called on a trail from a region other than the region in which the trail was created.
-
InvalidInsightSelectorsException:
The formatting or syntax of the
InsightSelectors
JSON statement in yourPutInsightSelectors
orGetInsightSelectors
request is not valid, or the specified insight type in theInsightSelectors
statement is not a valid insight type. -
InsufficientS3BucketPolicyException:
This exception is thrown when the policy on the S3 bucket is not sufficient.
-
InsufficientEncryptionPolicyException:
This exception is thrown when the policy on the S3 bucket or KMS key is not sufficient.
-
S3BucketDoesNotExistException:
This exception is thrown when the specified S3 bucket does not exist.
-
This exception is thrown when there is an issue with the specified KMS key and the trail can’t be updated.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
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 Create an event data store.
RemoveTags
$result = $client->removeTags
([/* ... */]); $promise = $client->removeTagsAsync
([/* ... */]);
Removes the specified tags from a trail or event data store.
Parameter Syntax
$result = $client->removeTags([ 'ResourceId' => '<string>', // REQUIRED 'TagsList' => [ // REQUIRED [ 'Key' => '<string>', // REQUIRED 'Value' => '<string>', ], // ... ], ]);
Parameter Details
Members
- ResourceId
-
- Required: Yes
- Type: string
Specifies the ARN of the trail or event data store from which tags should be removed.
Example trail ARN format:
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Example event data store ARN format:
arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE
- TagsList
-
- Required: Yes
- Type: Array of Tag structures
Specifies a list of tags to be removed.
Result Syntax
[]
Result Details
Errors
-
This exception is thrown when the specified resource is not found.
-
CloudTrailARNInvalidException:
This exception is thrown when an operation is called with a trail ARN that is not valid. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
-
ResourceTypeNotSupportedException:
This exception is thrown when the specified resource type is not supported by CloudTrail.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
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.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
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 Create an event data store.
RestoreEventDataStore
$result = $client->restoreEventDataStore
([/* ... */]); $promise = $client->restoreEventDataStoreAsync
([/* ... */]);
Restores a deleted event data store specified by EventDataStore
, which accepts an event data store ARN. You can only restore a deleted event data store within the seven-day wait period after deletion. Restoring an event data store can take several minutes, depending on the size of the event data store.
Parameter Syntax
$result = $client->restoreEventDataStore([ 'EventDataStore' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'CreatedTimestamp' => <DateTime>, 'EventDataStoreArn' => '<string>', 'MultiRegionEnabled' => true || false, 'Name' => '<string>', 'OrganizationEnabled' => true || false, 'RetentionPeriod' => <integer>, 'Status' => 'CREATED|ENABLED|PENDING_DELETION', 'TerminationProtectionEnabled' => true || false, 'UpdatedTimestamp' => <DateTime>, ]
Result Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
The advanced event selectors that were used to select events.
- CreatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The timestamp of an event data store's creation.
- EventDataStoreArn
-
- Type: string
The event data store ARN.
- MultiRegionEnabled
-
- Type: boolean
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.
- Name
-
- Type: string
The name of the event data store.
- OrganizationEnabled
-
- Type: boolean
Indicates whether an event data store is collecting logged events for an organization in Organizations.
- RetentionPeriod
-
- Type: int
The retention period, in days.
- Status
-
- Type: string
The status of the event data store.
- TerminationProtectionEnabled
-
- Type: boolean
Indicates that termination protection is enabled and the event data store cannot be automatically deleted.
- UpdatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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
.
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
EventDataStoreMaxLimitExceededException:
Your account has used the maximum number of event data stores.
-
InvalidEventDataStoreStatusException:
The event data store is not in a status that supports the operation.
-
The request includes a parameter that is not valid.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
CloudTrailAccessNotEnabledException:
This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see Enabling Trusted Access with Other Amazon Web Services Services and Prepare For Creating a Trail For Your Organization.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
-
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.
-
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 Create an event data store.
-
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.
StartLogging
$result = $client->startLogging
([/* ... */]); $promise = $client->startLoggingAsync
([/* ... */]);
Starts the recording of Amazon Web Services API calls and log file delivery for a trail. For a trail that is enabled in all regions, this operation must be called from the region in which the trail was created. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail that is enabled in all regions.
Parameter Syntax
$result = $client->startLogging([ 'Name' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
This exception is thrown when an operation is called on a trail from a region other than the region in which the trail was created.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
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 Create an event data store.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
StartQuery
$result = $client->startQuery
([/* ... */]); $promise = $client->startQueryAsync
([/* ... */]);
Starts a CloudTrail Lake query. The required QueryStatement
parameter provides your SQL query, enclosed in single quotation marks.
Parameter Syntax
$result = $client->startQuery([ 'QueryStatement' => '<string>', // REQUIRED ]);
Parameter Details
Result Syntax
[ 'QueryId' => '<string>', ]
Result Details
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
The request includes a parameter that is not valid.
-
InvalidQueryStatementException:
The query that was submitted has validation errors, or uses incorrect syntax or unsupported keywords. For more information about writing a query, see Create or edit a query in the CloudTrail User Guide.
-
MaxConcurrentQueriesException:
You are already running the maximum number of concurrent queries. Wait a minute for some queries to finish, and then run the query again.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
StopLogging
$result = $client->stopLogging
([/* ... */]); $promise = $client->stopLoggingAsync
([/* ... */]);
Suspends the recording of Amazon Web Services API calls and log file delivery for the specified trail. Under most circumstances, there is no need to use this action. You can update a trail without stopping it first. This action is the only way to stop recording. For a trail enabled in all regions, this operation must be called from the region in which the trail was created, or an InvalidHomeRegionException
will occur. This operation cannot be called on the shadow trails (replicated trails in other regions) of a trail enabled in all regions.
Parameter Syntax
$result = $client->stopLogging([ 'Name' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[]
Result Details
Errors
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
This exception is thrown when an operation is called on a trail from a region other than the region in which the trail was created.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
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 Create an event data store.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
UpdateEventDataStore
$result = $client->updateEventDataStore
([/* ... */]); $promise = $client->updateEventDataStoreAsync
([/* ... */]);
Updates an event data store. The required EventDataStore
value is an ARN or the ID portion of the ARN. Other parameters are optional, but at least one optional parameter must be specified, or CloudTrail throws an error. RetentionPeriod
is in days, and valid values are integers between 90 and 2555. By default, TerminationProtection
is enabled. AdvancedEventSelectors
includes or excludes management and data events in your event data store; for more information about AdvancedEventSelectors
, see PutEventSelectorsRequest$AdvancedEventSelectors.
Parameter Syntax
$result = $client->updateEventDataStore([ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ // REQUIRED [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', // REQUIRED 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'EventDataStore' => '<string>', // REQUIRED 'MultiRegionEnabled' => true || false, 'Name' => '<string>', 'OrganizationEnabled' => true || false, 'RetentionPeriod' => <integer>, 'TerminationProtectionEnabled' => true || false, ]);
Parameter Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
The advanced event selectors used to select events for the event data store.
- EventDataStore
-
- Required: Yes
- Type: string
The ARN (or the ID suffix of the ARN) of the event data store that you want to update.
- MultiRegionEnabled
-
- Type: boolean
Specifies whether an event data store collects events from all regions, or only from the region in which it was created.
- Name
-
- Type: string
The event data store name.
- OrganizationEnabled
-
- Type: boolean
Specifies whether an event data store collects events logged for an organization in Organizations.
- RetentionPeriod
-
- Type: int
The retention period, in days.
- TerminationProtectionEnabled
-
- Type: boolean
Indicates that termination protection is enabled and the event data store cannot be automatically deleted.
Result Syntax
[ 'AdvancedEventSelectors' => [ [ 'FieldSelectors' => [ [ 'EndsWith' => ['<string>', ...], 'Equals' => ['<string>', ...], 'Field' => '<string>', 'NotEndsWith' => ['<string>', ...], 'NotEquals' => ['<string>', ...], 'NotStartsWith' => ['<string>', ...], 'StartsWith' => ['<string>', ...], ], // ... ], 'Name' => '<string>', ], // ... ], 'CreatedTimestamp' => <DateTime>, 'EventDataStoreArn' => '<string>', 'MultiRegionEnabled' => true || false, 'Name' => '<string>', 'OrganizationEnabled' => true || false, 'RetentionPeriod' => <integer>, 'Status' => 'CREATED|ENABLED|PENDING_DELETION', 'TerminationProtectionEnabled' => true || false, 'UpdatedTimestamp' => <DateTime>, ]
Result Details
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
The advanced event selectors that are applied to the event data store.
- CreatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The timestamp that shows when an event data store was first created.
- EventDataStoreArn
-
- Type: string
The ARN of the event data store.
- MultiRegionEnabled
-
- Type: boolean
Indicates whether the event data store includes events from all regions, or only from the region in which it was created.
- Name
-
- Type: string
The name of the event data store.
- OrganizationEnabled
-
- Type: boolean
Indicates whether an event data store is collecting logged events for an organization in Organizations.
- RetentionPeriod
-
- Type: int
The retention period, in days.
- Status
-
- Type: string
The status of an event data store. Values can be
ENABLED
andPENDING_DELETION
. - TerminationProtectionEnabled
-
- Type: boolean
Indicates whether termination protection is enabled for the event data store.
- UpdatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
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
.
Errors
-
EventDataStoreARNInvalidException:
The specified event data store ARN is not valid or does not map to an event data store in your account.
-
EventDataStoreNotFoundException:
The specified event data store was not found.
-
InactiveEventDataStoreException:
The event data store is inactive.
-
The request includes a parameter that is not valid.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
CloudTrailAccessNotEnabledException:
This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see Enabling Trusted Access with Other Amazon Web Services Services and Prepare For Creating a Trail For Your Organization.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
-
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.
-
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 Create an event data store.
-
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.
UpdateTrail
$result = $client->updateTrail
([/* ... */]); $promise = $client->updateTrailAsync
([/* ... */]);
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 the trail was created; otherwise, an InvalidHomeRegionException
is thrown.
Parameter Syntax
$result = $client->updateTrail([ 'CloudWatchLogsLogGroupArn' => '<string>', 'CloudWatchLogsRoleArn' => '<string>', 'EnableLogFileValidation' => true || false, 'IncludeGlobalServiceEvents' => true || false, 'IsMultiRegionTrail' => true || false, 'IsOrganizationTrail' => true || false, 'KmsKeyId' => '<string>', 'Name' => '<string>', // REQUIRED 'S3BucketName' => '<string>', 'S3KeyPrefix' => '<string>', 'SnsTopicName' => '<string>', ]);
Parameter Details
Members
- CloudWatchLogsLogGroupArn
-
- Type: 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
. - CloudWatchLogsRoleArn
-
- Type: string
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
- EnableLogFileValidation
-
- Type: boolean
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.
- IncludeGlobalServiceEvents
-
- Type: boolean
Specifies whether the trail is publishing events from global services such as IAM to the log files.
- IsMultiRegionTrail
-
- Type: boolean
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.
- IsOrganizationTrail
-
- Type: boolean
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. - KmsKeyId
-
- Type: 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
- Name
-
- Required: Yes
- Type: 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
- S3BucketName
-
- Type: string
Specifies the name of the Amazon S3 bucket designated for publishing log files. See Amazon S3 Bucket Naming Requirements.
- S3KeyPrefix
-
- Type: 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.
- SnsTopicName
-
- Type: string
Specifies the name of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.
Result Syntax
[ 'CloudWatchLogsLogGroupArn' => '<string>', 'CloudWatchLogsRoleArn' => '<string>', 'IncludeGlobalServiceEvents' => true || false, 'IsMultiRegionTrail' => true || false, 'IsOrganizationTrail' => true || false, 'KmsKeyId' => '<string>', 'LogFileValidationEnabled' => true || false, 'Name' => '<string>', 'S3BucketName' => '<string>', 'S3KeyPrefix' => '<string>', 'SnsTopicARN' => '<string>', 'SnsTopicName' => '<string>', 'TrailARN' => '<string>', ]
Result Details
Members
- CloudWatchLogsLogGroupArn
-
- Type: string
Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail logs are delivered.
- CloudWatchLogsRoleArn
-
- Type: string
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
- IncludeGlobalServiceEvents
-
- Type: boolean
Specifies whether the trail is publishing events from global services such as IAM to the log files.
- IsMultiRegionTrail
-
- Type: boolean
Specifies whether the trail exists in one region or in all regions.
- IsOrganizationTrail
-
- Type: boolean
Specifies whether the trail is an organization trail.
- KmsKeyId
-
- Type: 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
- LogFileValidationEnabled
-
- Type: boolean
Specifies whether log file integrity validation is enabled.
- Name
-
- Type: string
Specifies the name of the trail.
- S3BucketName
-
- Type: string
Specifies the name of the Amazon S3 bucket designated for publishing log files.
- S3KeyPrefix
-
- Type: 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.
- SnsTopicARN
-
- Type: 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
- SnsTopicName
-
- Type: string
This field is no longer in use. Use UpdateTrailResponse$SnsTopicARN.
- TrailARN
-
- Type: 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
Errors
-
S3BucketDoesNotExistException:
This exception is thrown when the specified S3 bucket does not exist.
-
InsufficientS3BucketPolicyException:
This exception is thrown when the policy on the S3 bucket is not sufficient.
-
InsufficientSnsTopicPolicyException:
This exception is thrown when the policy on the Amazon SNS topic is not sufficient.
-
InsufficientEncryptionPolicyException:
This exception is thrown when the policy on the S3 bucket or KMS key is not sufficient.
-
This exception is thrown when the trail with the given name is not found.
-
This exception is thrown when the provided S3 bucket name is not valid.
-
This exception is thrown when the provided S3 prefix is not valid.
-
This exception is thrown when the provided SNS topic name is not valid.
-
This exception is thrown when the KMS key ARN is not valid.
-
This exception is thrown when the provided trail name is not valid. Trail names 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)
-
-
This exception is no longer in use.
-
InvalidEventSelectorsException:
This exception is thrown when the
PutEventSelectors
operation 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
ReadWriteType
parameter with a value ofread-only
is not valid.
-
-
InvalidParameterCombinationException:
This exception is thrown when the combination of parameters provided is not valid.
-
This exception is thrown when an operation is called on a trail from a region other than the region in which the trail was created.
-
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.
-
This exception is no longer in use.
-
This exception is thrown when there is an issue with the specified KMS key and the trail can’t be updated.
-
InvalidCloudWatchLogsLogGroupArnException:
This exception is thrown when the provided CloudWatch Logs log group is not valid.
-
InvalidCloudWatchLogsRoleArnException:
This exception is thrown when the provided role is not valid.
-
CloudWatchLogsDeliveryUnavailableException:
Cannot set a CloudWatch Logs delivery for this region.
-
UnsupportedOperationException:
This exception is thrown when the requested operation is not supported.
-
OperationNotPermittedException:
This exception is thrown when the requested operation is not permitted.
-
CloudTrailAccessNotEnabledException:
This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see Enabling Trusted Access with Other Amazon Web Services Services and Prepare For Creating a Trail For Your Organization.
-
InsufficientDependencyServiceAccessPermissionException:
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
-
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.
-
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 Create an event data store.
-
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.
-
CloudTrailInvalidClientTokenIdException:
This exception is thrown when a call results in the
InvalidClientTokenId
error code. This can occur when you are creating or updating a trail to send notifications to an Amazon SNS topic that is in a suspended Amazon Web Services account.
Shapes
AdvancedEventSelector
Description
Advanced event selectors let you create fine-grained selectors for the following CloudTrail event record fields. They help you control costs by logging only those events that are important to you. For more information about advanced event selectors, see Logging data events for trails in the CloudTrail User Guide.
-
readOnly
-
eventSource
-
eventName
-
eventCategory
-
resources.type
-
resources.ARN
You cannot apply both event selectors and advanced event selectors to a trail.
Members
- FieldSelectors
-
- Required: Yes
- Type: Array of AdvancedFieldSelector structures
Contains all selector statements in an advanced event selector.
- Name
-
- Type: string
An optional, descriptive name for an advanced event selector, such as "Log data events for only two S3 buckets".
AdvancedFieldSelector
Description
A single selector statement in an advanced event selector.
Members
- EndsWith
-
- Type: Array of strings
An operator that includes events that match the last few characters of the event record field specified as the value of
Field
. - Equals
-
- Type: Array of strings
An operator that includes events that match the exact value of the event record field specified as the value of
Field
. This is the only valid operator that you can use with thereadOnly
,eventCategory
, andresources.type
fields. - Field
-
- Required: Yes
- Type: string
A field in an event record on which to filter events to be logged. Supported fields include
readOnly
,eventCategory
,eventSource
(for management events),eventName
,resources.type
, andresources.ARN
.-
readOnly
- Optional. Can be set toEquals
a value oftrue
orfalse
. If you do not add this field, CloudTrail logs both bothread
andwrite
events. A value oftrue
logs onlyread
events. A value offalse
logs onlywrite
events. -
eventSource
- For filtering management events only. This can be set only toNotEquals
kms.amazonaws.com
. -
eventName
- Can use any operator. You can use it to filter in or filter out any data event logged to CloudTrail, such asPutBucket
orGetSnapshotBlock
. You can have multiple values for this field, separated by commas. -
eventCategory
- This is required. It must be set toEquals
, and the value must beManagement
orData
. -
resources.type
- This field is required.resources.type
can only use theEquals
operator, and the value can be one of the following:-
AWS::S3::Object
-
AWS::Lambda::Function
-
AWS::DynamoDB::Table
-
AWS::S3Outposts::Object
-
AWS::ManagedBlockchain::Node
-
AWS::S3ObjectLambda::AccessPoint
-
AWS::EC2::Snapshot
-
AWS::S3::AccessPoint
-
AWS::DynamoDB::Stream
-
AWS::Glue::Table
You can have only one
resources.type
field per selector. To log data events on more than one resource type, add another selector. -
-
resources.ARN
- You can use any operator withresources.ARN
, but if you useEquals
orNotEquals
, the value must exactly match the ARN of a valid resource of the type you've specified in the template as the value of resources.type. For example, if resources.type equalsAWS::S3::Object
, the ARN must be in one of the following formats. To log all data events for all objects in a specific S3 bucket, use theStartsWith
operator, and include only the bucket ARN as the matching value.The trailing slash is intentional; do not exclude it. Replace the text between less than and greater than symbols (<>) with resource-specific information.
-
arn:<partition>:s3:::<bucket_name>/
-
arn:<partition>:s3:::<bucket_name>/<object_path>/
When
resources.type
equalsAWS::S3::AccessPoint
, and the operator is set toEquals
orNotEquals
, the ARN must be in one of the following formats. To log events on all objects in an S3 access point, we recommend that you use only the access point ARN, don’t include the object path, and use theStartsWith
orNotStartsWith
operators.-
arn:<partition>:s3:<region>:<account_ID>:accesspoint/<access_point_name>
-
arn:<partition>:s3:<region>:<account_ID>:accesspoint/<access_point_name>/object/<object_path>
When resources.type equals
AWS::Lambda::Function
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:lambda:<region>:<account_ID>:function:<function_name>
When resources.type equals
AWS::DynamoDB::Table
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:dynamodb:<region>:<account_ID>:table/<table_name>
When
resources.type
equalsAWS::S3Outposts::Object
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:s3-outposts:<region>:<account_ID>:<object_path>
When
resources.type
equalsAWS::ManagedBlockchain::Node
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:managedblockchain:<region>:<account_ID>:nodes/<node_ID>
When
resources.type
equalsAWS::S3ObjectLambda::AccessPoint
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:s3-object-lambda:<region>:<account_ID>:accesspoint/<access_point_name>
When
resources.type
equalsAWS::EC2::Snapshot
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:ec2:<region>::snapshot/<snapshot_ID>
When
resources.type
equalsAWS::DynamoDB::Stream
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:dynamodb:<region>:<account_ID>:table/<table_name>/stream/<date_time>
When
resources.type
equalsAWS::Glue::Table
, and the operator is set toEquals
orNotEquals
, the ARN must be in the following format:-
arn:<partition>:glue:<region>:<account_ID>:table/<database_name>/<table_name>
-
- NotEndsWith
-
- Type: Array of strings
An operator that excludes events that match the last few characters of the event record field specified as the value of
Field
. - NotEquals
-
- Type: Array of strings
An operator that excludes events that match the exact value of the event record field specified as the value of
Field
. - NotStartsWith
-
- Type: Array of strings
An operator that excludes events that match the first few characters of the event record field specified as the value of
Field
. - StartsWith
-
- Type: Array of strings
An operator that includes events that match the first few characters of the event record field specified as the value of
Field
.
CloudTrailARNInvalidException
Description
This exception is thrown when an operation is called with a trail ARN that is not valid. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
Members
CloudTrailAccessNotEnabledException
Description
This exception is thrown when trusted access has not been enabled between CloudTrail and Organizations. For more information, see Enabling Trusted Access with Other Amazon Web Services Services and Prepare For Creating a Trail For Your Organization.
Members
CloudTrailInvalidClientTokenIdException
Description
This exception is thrown when a call results in the InvalidClientTokenId
error code. This can occur when you are creating or updating a trail to send notifications to an Amazon SNS topic that is in a suspended Amazon Web Services account.
Members
CloudWatchLogsDeliveryUnavailableException
Description
Cannot set a CloudWatch Logs delivery for this region.
Members
ConflictException
Description
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. If this exception occurs, wait a few minutes, and then try the operation again.
Members
DataResource
Description
The Amazon S3 buckets, Lambda functions, or Amazon DynamoDB tables that you specify in your event selectors for your trail to log data events. Data events provide information about the resource operations performed on or within a resource itself. These are also known as data plane operations. You can specify up to 250 data resources for a trail.
The total number of allowed data resources is 250. This number can be distributed between 1 and 5 event selectors, but the total cannot exceed 250 across all selectors.
If you are using advanced event selectors, the maximum total number of values for all conditions, across all advanced event selectors for the trail, is 500.
The following example demonstrates how logging works when you configure logging of all data events for an S3 bucket named bucket-1
. In this example, the CloudTrail user specified an empty prefix, and the option to log both Read
and Write
data events.
-
A user uploads an image file to
bucket-1
. -
The
PutObject
API operation is an Amazon S3 object-level API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified an S3 bucket with an empty prefix, events that occur on any object in that bucket are logged. The trail processes and logs the event. -
A user uploads an object to an Amazon S3 bucket named
arn:aws:s3:::bucket-2
. -
The
PutObject
API operation occurred for an object in an S3 bucket that the CloudTrail user didn't specify for the trail. The trail doesn’t log the event.
The following example demonstrates how logging works when you configure logging of Lambda data events for a Lambda function named MyLambdaFunction, but not for all Lambda functions.
-
A user runs a script that includes a call to the MyLambdaFunction function and the MyOtherLambdaFunction function.
-
The
Invoke
API operation on MyLambdaFunction is an Lambda API. It is recorded as a data event in CloudTrail. Because the CloudTrail user specified logging data events for MyLambdaFunction, any invocations of that function are logged. The trail processes and logs the event. -
The
Invoke
API operation on MyOtherLambdaFunction is an Lambda API. Because the CloudTrail user did not specify logging data events for all Lambda functions, theInvoke
operation for MyOtherLambdaFunction does not match the function specified for the trail. The trail doesn’t log the event.
Members
- Type
-
- Type: string
The resource type in which you want to log data events. You can specify the following basic event selector resource types:
-
AWS::S3::Object
-
AWS::Lambda::Function
-
AWS::DynamoDB::Table
The following resource types are also availble through advanced event selectors. Basic event selector resource types are valid in advanced event selectors, but advanced event selector resource types are not valid in basic event selectors. For more information, see AdvancedFieldSelector$Field.
-
AWS::S3Outposts::Object
-
AWS::ManagedBlockchain::Node
-
AWS::S3ObjectLambda::AccessPoint
-
AWS::EC2::Snapshot
-
AWS::S3::AccessPoint
-
AWS::DynamoDB::Stream
-
AWS::Glue::Table
- Values
-
- Type: Array of strings
An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects.
-
To log data events for all objects in all S3 buckets in your Amazon Web Services account, specify the prefix as
arn:aws:s3:::
.This also enables logging of data event activity performed by any user or role in your Amazon Web Services account, even if that activity is performed on a bucket that belongs to another Amazon Web Services account.
-
To log data events for all objects in an S3 bucket, specify the bucket and an empty object prefix such as
arn:aws:s3:::bucket-1/
. The trail logs data events for all objects in this S3 bucket. -
To log data events for specific objects, specify the S3 bucket and object prefix such as
arn:aws:s3:::bucket-1/example-images
. The trail logs data events for objects in this S3 bucket that match the prefix. -
To log data events for all Lambda functions in your Amazon Web Services account, specify the prefix as
arn:aws:lambda
.This also enables logging of
Invoke
activity performed by any user or role in your Amazon Web Services account, even if that activity is performed on a function that belongs to another Amazon Web Services account. -
To log data events for a specific Lambda function, specify the function ARN.
Lambda function ARNs are exact. For example, if you specify a function ARN arn:aws:lambda:us-west-2:111111111111:function:helloworld, data events will only be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld. They will not be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld2.
-
To log data events for all DynamoDB tables in your Amazon Web Services account, specify the prefix as
arn:aws:dynamodb
.
Event
Description
Contains information about an event that was returned by a lookup request. The result includes a representation of a CloudTrail event.
Members
- AccessKeyId
-
- Type: string
The Amazon Web Services access key ID that was used to sign the request. If the request was made with temporary security credentials, this is the access key ID of the temporary credentials.
- CloudTrailEvent
-
- Type: string
A JSON string that contains a representation of the event returned.
- EventId
-
- Type: string
The CloudTrail ID of the event returned.
- EventName
-
- Type: string
The name of the event returned.
- EventSource
-
- Type: string
The Amazon Web Services service to which the request was made.
- EventTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The date and time of the event returned.
- ReadOnly
-
- Type: string
Information about whether the event is a write event or a read event.
- Resources
-
- Type: Array of Resource structures
A list of resources referenced by the event returned.
- Username
-
- Type: string
A user name or role name of the requester that called the API in the event returned.
EventDataStore
Description
A storage lake of event data against which you can run complex SQL-based queries. An event data store can include events that you have logged on your account from the last 90 to 2555 days (about three months to up to seven years). To select events for an event data store, use advanced event selectors.
Members
- AdvancedEventSelectors
-
- Type: Array of AdvancedEventSelector structures
This field is being deprecated. The advanced event selectors that were used to select events for the data store.
- CreatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
This field is being deprecated. The timestamp of the event data store's creation.
- EventDataStoreArn
-
- Type: string
The ARN of the event data store.
- MultiRegionEnabled
-
- Type: boolean
This field is being deprecated. Indicates whether the event data store includes events from all regions, or only from the region in which it was created.
- Name
-
- Type: string
The name of the event data store.
- OrganizationEnabled
-
- Type: boolean
This field is being deprecated. Indicates that an event data store is collecting logged events for an organization.
- RetentionPeriod
-
- Type: int
This field is being deprecated. The retention period, in days.
- Status
-
- Type: string
This field is being deprecated. The status of an event data store. Values are
ENABLED
andPENDING_DELETION
. - TerminationProtectionEnabled
-
- Type: boolean
This field is being deprecated. Indicates whether the event data store is protected from termination.
- UpdatedTimestamp
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
This field is being deprecated. The timestamp showing when an event data store was updated, if applicable.
UpdatedTimestamp
is always either the same or newer than the time shown inCreatedTimestamp
.
EventDataStoreARNInvalidException
Description
The specified event data store ARN is not valid or does not map to an event data store in your account.
Members
EventDataStoreAlreadyExistsException
Description
An event data store with that name already exists.
Members
EventDataStoreMaxLimitExceededException
Description
Your account has used the maximum number of event data stores.
Members
EventDataStoreNotFoundException
Description
The specified event data store was not found.
Members
EventDataStoreTerminationProtectedException
Description
The event data store cannot be deleted because termination protection is enabled for it.
Members
EventSelector
Description
Use event selectors to further specify the management and data event settings for your trail. By default, trails created without specific event selectors will be configured to log all read and write management events, and no data events. When an event occurs in your account, CloudTrail evaluates the event selector for all trails. For each trail, if the event matches any event selector, the trail processes and logs the event. If the event doesn't match any event selector, the trail doesn't log the event.
You can configure up to five event selectors for a trail.
You cannot apply both event selectors and advanced event selectors to a trail.
Members
- DataResources
-
- Type: Array of DataResource structures
CloudTrail supports data event logging for Amazon S3 objects, Lambda functions, and Amazon DynamoDB tables with basic event selectors. You can specify up to 250 resources for an individual event selector, but the total number of data resources cannot exceed 250 across all event selectors in a trail. This limit does not apply if you configure resource logging for all data events.
For more information, see Data Events and Limits in CloudTrail in the CloudTrail User Guide.
- ExcludeManagementEventSources
-
- Type: Array of strings
An optional list of service event sources from which you do not want management events to be logged on your trail. In this release, the list can be empty (disables the filter), or it can filter out Key Management Service or Amazon RDS Data API events by containing
kms.amazonaws.com
orrdsdata.amazonaws.com
. By default,ExcludeManagementEventSources
is empty, and KMS and Amazon RDS Data API events are logged to your trail. You can exclude management event sources only in regions that support the event source. - IncludeManagementEvents
-
- Type: boolean
Specify if you want your event selector to include management events for your trail.
For more information, see Management Events in the CloudTrail User Guide.
By default, the value is
true
.The first copy of management events is free. You are charged for additional copies of management events that you are logging on any subsequent trail in the same region. For more information about CloudTrail pricing, see CloudTrail Pricing.
- ReadWriteType
-
- Type: string
Specify if you want your trail to log read-only events, write-only events, or all. For example, the EC2
GetConsoleOutput
is a read-only API operation andRunInstances
is a write-only API operation.By default, the value is
All
.
InactiveEventDataStoreException
Description
The event data store is inactive.
Members
InactiveQueryException
Description
The specified query cannot be canceled because it is in the FINISHED
, FAILED
, TIMED_OUT
, or CANCELLED
state.
Members
InsightNotEnabledException
Description
If you run GetInsightSelectors
on a trail that does not have Insights events enabled, the operation throws the exception InsightNotEnabledException
.
Members
InsightSelector
Description
A JSON string that contains a list of insight types that are logged on a trail.
Members
InsufficientDependencyServiceAccessPermissionException
Description
This exception is thrown when the IAM user or role that is used to create the organization resource lacks one or more required permissions for creating an organization resource in a required service.
Members
InsufficientEncryptionPolicyException
Description
This exception is thrown when the policy on the S3 bucket or KMS key is not sufficient.
Members
InsufficientS3BucketPolicyException
Description
This exception is thrown when the policy on the S3 bucket is not sufficient.
Members
InsufficientSnsTopicPolicyException
Description
This exception is thrown when the policy on the Amazon SNS topic is not sufficient.
Members
InvalidCloudWatchLogsLogGroupArnException
Description
This exception is thrown when the provided CloudWatch Logs log group is not valid.
Members
InvalidCloudWatchLogsRoleArnException
Description
This exception is thrown when the provided role is not valid.
Members
InvalidDateRangeException
Description
A date range for the query was specified that is not valid. Be sure that the start time is chronologically before the end time. For more information about writing a query, see Create or edit a query in the CloudTrail User Guide.
Members
InvalidEventCategoryException
Description
Occurs if an event category that is not valid is specified as a value of EventCategory
.
Members
InvalidEventDataStoreStatusException
Description
The event data store is not in a status that supports the operation.
Members
InvalidEventSelectorsException
Description
This exception is thrown when the PutEventSelectors
operation 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
ReadWriteType
parameter with a value ofread-only
is not valid.
Members
InvalidHomeRegionException
Description
This exception is thrown when an operation is called on a trail from a region other than the region in which the trail was created.
Members
InvalidInsightSelectorsException
Description
The formatting or syntax of the InsightSelectors
JSON statement in your PutInsightSelectors
or GetInsightSelectors
request is not valid, or the specified insight type in the InsightSelectors
statement is not a valid insight type.
Members
InvalidKmsKeyIdException
Description
This exception is thrown when the KMS key ARN is not valid.
Members
InvalidLookupAttributesException
Description
Occurs when a lookup attribute is specified that is not valid.
Members
InvalidMaxResultsException
Description
This exception is thrown if the limit specified is not valid.
Members
InvalidNextTokenException
Description
A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.
Members
InvalidParameterCombinationException
Description
This exception is thrown when the combination of parameters provided is not valid.
Members
InvalidParameterException
Description
The request includes a parameter that is not valid.
Members
InvalidQueryStatementException
Description
The query that was submitted has validation errors, or uses incorrect syntax or unsupported keywords. For more information about writing a query, see Create or edit a query in the CloudTrail User Guide.
Members
InvalidQueryStatusException
Description
The query status is not valid for the operation.
Members
InvalidS3BucketNameException
Description
This exception is thrown when the provided S3 bucket name is not valid.
Members
InvalidS3PrefixException
Description
This exception is thrown when the provided S3 prefix is not valid.
Members
InvalidSnsTopicNameException
Description
This exception is thrown when the provided SNS topic name is not valid.
Members
InvalidTagParameterException
Description
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.
Members
InvalidTimeRangeException
Description
Occurs if the timestamp values are not valid. Either the start time occurs after the end time, or the time range is outside the range of possible values.
Members
InvalidTokenException
Description
Reserved for future use.
Members
InvalidTrailNameException
Description
This exception is thrown when the provided trail name is not valid. Trail names 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)
Members
KmsException
Description
This exception is thrown when there is an issue with the specified KMS key and the trail can’t be updated.
Members
KmsKeyDisabledException
Description
This exception is no longer in use.
Members
KmsKeyNotFoundException
Description
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.
Members
LookupAttribute
Description
Specifies an attribute and value that filter the events returned.
Members
MaxConcurrentQueriesException
Description
You are already running the maximum number of concurrent queries. Wait a minute for some queries to finish, and then run the query again.
Members
MaximumNumberOfTrailsExceededException
Description
This exception is thrown when the maximum number of trails is reached.
Members
NotOrganizationMasterAccountException
Description
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 Create an event data store.
Members
OperationNotPermittedException
Description
This exception is thrown when the requested operation is not permitted.
Members
OrganizationNotInAllFeaturesModeException
Description
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.
Members
OrganizationsNotInUseException
Description
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.
Members
PublicKey
Description
Contains information about a returned public key.
Members
- Fingerprint
-
- Type: string
The fingerprint of the public key.
- ValidityEndTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The ending time of validity of the public key.
- ValidityStartTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The starting time of validity of the public key.
- Value
-
- Type: blob (string|resource|Psr\Http\Message\StreamInterface)
The DER encoded public key value in PKCS#1 format.
Query
Description
A SQL string of criteria about events that you want to collect in an event data store.
Members
QueryIdNotFoundException
Description
The query ID does not exist or does not map to a query.
Members
QueryStatistics
Description
Metadata about a query, such as the number of results.
Members
- BytesScanned
-
- Type: long (int|float)
The total bytes that the query scanned in the event data store. This value matches the number of bytes for which your account is billed for the query, unless the query is still running.
- ResultsCount
-
- Type: int
The number of results returned.
- TotalResultsCount
-
- Type: int
The total number of results returned by a query.
QueryStatisticsForDescribeQuery
Description
Gets 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.
Members
- BytesScanned
-
- Type: long (int|float)
The total bytes that the query scanned in the event data store. This value matches the number of bytes for which your account is billed for the query, unless the query is still running.
- CreationTime
-
- Type: timestamp (string|DateTime or anything parsable by strtotime)
The creation time of the query.
- EventsMatched
-
- Type: long (int|float)
The number of events that matched a query.
- EventsScanned
-
- Type: long (int|float)
The number of events that the query scanned in the event data store.
- ExecutionTimeInMillis
-
- Type: int
The query's run time, in milliseconds.
Resource
Description
Specifies the type and name of a resource referenced by an event.
Members
- ResourceName
-
- Type: string
The name of the resource referenced by the event returned. These are user-created names whose values will depend on the environment. For example, the resource name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567" for an EC2 Instance.
- ResourceType
-
- Type: string
The type of a resource referenced by the event returned. When the resource type cannot be determined, null is returned. Some examples of resource types are: Instance for EC2, Trail for CloudTrail, DBInstance for Amazon RDS, and AccessKey for IAM. To learn more about how to look up and filter events by the resource types supported for a service, see Filtering CloudTrail Events.
ResourceNotFoundException
Description
This exception is thrown when the specified resource is not found.
Members
ResourceTag
Description
A resource tag.
Members
- ResourceId
-
- Type: string
Specifies the ARN of the resource.
- TagsList
-
- Type: Array of Tag structures
A list of tags.
ResourceTypeNotSupportedException
Description
This exception is thrown when the specified resource type is not supported by CloudTrail.
Members
S3BucketDoesNotExistException
Description
This exception is thrown when the specified S3 bucket does not exist.
Members
Tag
Description
A custom key-value pair associated with a resource such as a CloudTrail trail.
Members
TagsLimitExceededException
Description
The number of tags per trail has exceeded the permitted amount. Currently, the limit is 50.
Members
Trail
Description
The settings for a trail.
Members
- CloudWatchLogsLogGroupArn
-
- Type: string
Specifies an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will be delivered.
- CloudWatchLogsRoleArn
-
- Type: string
Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group.
- HasCustomEventSelectors
-
- Type: boolean
Specifies if the trail has custom event selectors.
- HasInsightSelectors
-
- Type: boolean
Specifies whether a trail has insight types specified in an
InsightSelector
list. - HomeRegion
-
- Type: string
The region in which the trail was created.
- IncludeGlobalServiceEvents
-
- Type: boolean
Set to True to include Amazon Web Services API calls from Amazon Web Services global services such as IAM. Otherwise, False.
- IsMultiRegionTrail
-
- Type: boolean
Specifies whether the trail exists only in one region or exists in all regions.
- IsOrganizationTrail
-
- Type: boolean
Specifies whether the trail is an organization trail.
- KmsKeyId
-
- Type: 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
- LogFileValidationEnabled
-
- Type: boolean
Specifies whether log file validation is enabled.
- Name
-
- Type: string
Name of the trail set by calling CreateTrail. The maximum length is 128 characters.
- S3BucketName
-
- Type: string
Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. See Amazon S3 Bucket Naming Requirements.
- S3KeyPrefix
-
- Type: 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.
- SnsTopicARN
-
- Type: 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
- SnsTopicName
-
- Type: string
This field is no longer in use. Use SnsTopicARN.
- TrailARN
-
- Type: string
Specifies the ARN of the trail. The following is the format of a trail ARN.
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
TrailAlreadyExistsException
Description
This exception is thrown when the specified trail already exists.
Members
TrailInfo
Description
Information about a CloudTrail trail, including the trail's name, home region, and Amazon Resource Name (ARN).
Members
TrailNotFoundException
Description
This exception is thrown when the trail with the given name is not found.
Members
TrailNotProvidedException
Description
This exception is no longer in use.
Members
UnsupportedOperationException
Description
This exception is thrown when the requested operation is not supported.