AWS Global Accelerator
Developer Guide

Logging AWS Global Accelerator API Calls with AWS CloudTrail

AWS Global Accelerator is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Global Accelerator. CloudTrail captures all API calls for Global Accelerator as events, including calls from the Global Accelerator console and from code calls to the Global Accelerator API. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for Global Accelerator. 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 Global Accelerator, the IP address from which the request was made, who made the request, when it was made, and additional details.

To learn more about CloudTrail, see the AWS CloudTrail User Guide.

Global Accelerator Information in CloudTrail

CloudTrail is enabled on your AWS account when you create the account. When activity occurs in Global Accelerator, 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 Global Accelerator, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all regions. The trail logs events from all regions in the AWS partition and delivers the log files to the Amazon 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 topics:

All Global Accelerator actions are logged by CloudTrail and are documented in the AWS Global Accelerator API Reference. For example, calls to the CreateAccelerator, ListAccelerators and UpdateAccelerator operations 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 the following:

  • Whether the request was made with root or IAM user credentials

  • Whether the request was made with temporary security credentials for a role or federated user

  • Whether the request was made by another AWS service

For more information, see the CloudTrail userIdentity Element.

Understanding Global Accelerator Log File Entries

A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify. Each JSON-formatted CloudTrail log file can contain one or more log entries. A log entry represents a single request from any source and includes information about the requested action, including any parameters, the date and time of the action, and so on. The log entries are not guaranteed to be in any particular order; they are not an ordered stack trace of API calls.

The following example shows a CloudTrail log entry that includes these Global Accelerator actions:

  • Listing the accelerators for an account: eventName is ListAccelerators.

  • Creating a listener: eventName is CreateListener.

  • Updating a listener: eventName is UpdateListener.

  • Describing a listener: eventName is DescribeListener.

  • Listing the listeners for an account: eventName is ListListeners.

  • Deleting a listener: eventName is DeleteListener.

v{ "Records": [ { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-17T21:02:36Z" }, "sessionIssuer": { "type": "Role", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "userName": "smithj" } } }, "eventTime": "2018-11-17T21:03:14Z", "eventSource": "", "eventName": "ListAccelerators", "awsRegion": "us-west-2", "sourceIPAddress": "", "userAgent": "aws-cli/1.16.34 Python/2.7.10 Darwin/16.7.0 botocore/1.12.24", "requestParameters": null, "responseElements": null, "requestID": "083cae81-28ab-4a66-862f-096e1example", "eventID": "fe8b1c13-8757-4c73-b842-fe2a3example", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-17T21:02:36Z" }, "sessionIssuer": { "type": "Role", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "userName": "smithj" } } }, "eventTime": "2018-11-17T21:04:49Z", "eventSource": "", "eventName": "CreateListener", "awsRegion": "us-west-2", "sourceIPAddress": "", "userAgent": "aws-cli/1.16.34 Python/2.7.10 Darwin/16.7.0 botocore/1.12.24", "requestParameters": { "acceleratorArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample", "portRanges": [ { "fromPort": 80, "toPort": 80 } ], "protocol": "TCP" }, "responseElements": { "listener": { "listenerArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample/listener/abcde1234", "portRanges": [ { "fromPort": 80, "toPort": 80 } ], "protocol": "TCP", "clientAffinity": "NONE" } }, "requestID": "6090509a-5a97-4be6-8e6a-7d73example", "eventID": "9cab44ef-0777-41e6-838f-f249example", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-17T21:02:36Z" }, "sessionIssuer": { "type": "Role", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "userName": "smithj" } } }, "eventTime": "2018-11-17T21:03:52Z", "eventSource": "", "eventName": "CreateAccelerator", "awsRegion": "us-west-2", "sourceIPAddress": "", "userAgent": "aws-cli/1.16.34 Python/2.7.10 Darwin/16.7.0 botocore/1.12.24", "requestParameters": { "name": "cloudTrailTest" }, "responseElements": { "accelerator": { "acceleratorArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample", "name": "cloudTrailTest", "ipAddressType": "IPV4", "enabled": true, "ipSets": [ { "ipFamily": "IPv4", "ipAddresses": [ "", "" ] } ], "status": "IN_PROGRESS", "createdTime": "Nov 17, 2018 9:03:52 PM", "lastModifiedTime": "Nov 17, 2018 9:03:52 PM" } }, "requestID": "d2d7f300-2f0b-4bda-aa2d-e67d6e4example", "eventID": "11f9a762-8c00-4fcc-80f9-848a29example", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-17T21:02:36Z" }, "sessionIssuer": { "type": "Role", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "userName": "smithj" } } }, "eventTime": "2018-11-17T21:05:27Z", "eventSource": "", "eventName": "UpdateListener", "awsRegion": "us-west-2", "sourceIPAddress": "", "userAgent": "aws-cli/1.16.34 Python/2.7.10 Darwin/16.7.0 botocore/1.12.24", "requestParameters": { "listenerArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample/listener/abcde1234", "portRanges": [ { "fromPort": 80, "toPort": 80 }, { "fromPort": 81, "toPort": 81 } ] }, "responseElements": { "listener": { "listenerArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample/listener/abcde1234", "portRanges": [ { "fromPort": 80, "toPort": 80 }, { "fromPort": 81, "toPort": 81 } ], "protocol": "TCP", "clientAffinity": "NONE" } }, "requestID": "008ef93c-b3a3-44b4-afb3-768example", "eventID": "85958f0d-63ff-4a2c-99e3-6ffbexample", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-17T21:02:36Z" }, "sessionIssuer": { "type": "Role", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "userName": "smithj" } } }, "eventTime": "2018-11-17T21:06:05Z", "eventSource": "", "eventName": "DescribeListener", "awsRegion": "us-west-2", "sourceIPAddress": "", "userAgent": "aws-cli/1.16.34 Python/2.7.10 Darwin/16.7.0 botocore/1.12.24", "requestParameters": { "listenerArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample/listener/abcde1234" }, "responseElements": null, "requestID": "9980e368-82fa-40da-95a3-4b0example", "eventID": "885a02e9-2a60-4626-b1ba-57285example", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-17T21:02:36Z" }, "sessionIssuer": { "type": "Role", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "userName": "smithj" } } }, "eventTime": "2018-11-17T21:05:47Z", "eventSource": "", "eventName": "ListListeners", "awsRegion": "us-west-2", "sourceIPAddress": "", "userAgent": "aws-cli/1.16.34 Python/2.7.10 Darwin/16.7.0 botocore/1.12.24", "requestParameters": { "acceleratorArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample" }, "responseElements": null, "requestID": "08e4b0f7-689b-4c84-af2d-47619example", "eventID": "f4fb8e41-ed21-404d-af9d-037c4example", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" }, { "eventVersion": "1.05", "userIdentity": { "type": "IAMUser", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-11-17T21:02:36Z" }, "sessionIssuer": { "type": "Role", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/smithj", "accountId": "111122223333", "userName": "smithj" } } }, "eventTime": "2018-11-17T21:06:24Z", "eventSource": "", "eventName": "DeleteListener", "awsRegion": "us-west-2", "sourceIPAddress": "", "userAgent": "aws-cli/1.16.34 Python/2.7.10 Darwin/16.7.0 botocore/1.12.24", "requestParameters": { "listenerArn": "arn:aws:globalaccelerator::111122223333:accelerator/0339bfd6-13bc-4d45-a114-5d7fexample/listener/abcde1234" }, "responseElements": null, "requestID": "04d37bf9-3e50-41d9-9932-6112example", "eventID": "afedb874-2e21-4ada-b1b0-2ddb2example", "eventType": "AwsApiCall", "recipientAccountId": "111122223333" } ] }