Log AWS Outposts API calls using AWS CloudTrail - AWS Outposts

Log AWS Outposts API calls using AWS CloudTrail

AWS Outposts is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in AWS Outposts. CloudTrail captures all API calls for AWS Outposts as events. The calls captured include calls from the AWS Outposts console and code calls to the AWS Outposts API operations. If you create a trail, you can enable continuous delivery of CloudTrail events to an S3 bucket, including events for AWS Outposts. If you don't configure a trail, you can still view the most recent events in the CloudTrail console in Event history. Using the information collected by CloudTrail, you can determine the request that was made to AWS Outposts, the IP address from which the request was made, who made the request, when it was made, and additional details.

For more information about CloudTrail, see the AWS CloudTrail User Guide.

AWS Outposts information in CloudTrail

CloudTrail is enabled on your AWS account when you create the account. When activity occurs in AWS Outposts, that activity is recorded in a CloudTrail event along with other AWS service events in Event history. You can view, search, and download recent events in your AWS account. For more information, see Viewing events with CloudTrail event history.

For an ongoing record of events in your AWS account, including events for AWS Outposts, create a trail. A trail enables CloudTrail to deliver log files to an S3 bucket in the parent AWS Region. By default, when you create a trail in the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the AWS partition and delivers the log files to the S3 bucket that you specify. Additionally, you can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more information, see the following:

All AWS Outposts actions are logged by CloudTrail. They are documented in the AWS Outposts API Reference. For example, calls to the CreateOutpost, GetOutpostInstanceTypes, and ListSites actions generate entries in the CloudTrail log files.

Every event or log entry contains information about who generated the request. The identity information helps you determine whether the request was made:

  • With root or user credentials.

  • With temporary security credentials for a role or federated user.

  • By another AWS service.

For more information, see the CloudTrail userIdentity element.

Understanding AWS Outposts log file entries

A trail is a configuration that enables delivery of events as log files to an S3 bucket that you specify. CloudTrail log files contain one or more log entries. An event represents a single request from any source. It includes information about the requested action, the date and time of the action, request parameters, and so on. CloudTrail log files aren't an ordered stack trace of the public API calls, so they don't appear in any specific order.

The following example shows a CloudTrail log entry that demonstrates the CreateOutpost action.

{ "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AKIAIOSFODNN7EXAMPLE:jdoe", "arn": "arn:aws:sts::111122223333:assumed-role/example/jdoe", "accountId": "111122223333", "accessKeyId": "AKIAI44QH8DHBEXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:role/example", "accountId": "111122223333", "userName": "example" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-08-14T16:28:16Z" } } }, "eventTime": "2020-08-14T16:32:23Z", "eventSource": "outposts.amazonaws.com", "eventName": "SetSiteAddress", "awsRegion": "us-west-2", "sourceIPAddress": "XXX.XXX.XXX.XXX", "userAgent": "userAgent", "requestParameters": { "SiteId": "os-123ab4c56789de01f", "Address": "***" }, "responseElements": { "Address": "***", "SiteId": "os-123ab4c56789de01f" }, "requestID": "1abcd23e-f4gh-567j-klm8-9np01q234r56", "eventID": "1234a56b-c78d-9e0f-g1h2-34jk56m7n890", "readOnly": false, "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }