Using AWS CloudTrail to log AWS Global Accelerator API calls - AWS Global Accelerator

Using AWS CloudTrail to log AWS Global Accelerator API calls

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.

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 AWS Identity and Access Management (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.

Viewing Global Accelerator events in event history

CloudTrail lets you view recent events in Event history. To view events for Global Accelerator API requests, you must choose US West (Oregon) in the Region selector at the top of the console. For more information, see Viewing events with CloudTrail event history in the AWS CloudTrail User Guide.

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 contains 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. 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 includes the following 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.

{ "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": "globalaccelerator.amazonaws.com", "eventName": "ListAccelerators", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "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": "globalaccelerator.amazonaws.com", "eventName": "CreateListener", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "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": "globalaccelerator.amazonaws.com", "eventName": "CreateAccelerator", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "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": [ { "ipAddressFamily": "IPv4", "ipAddresses": [ "192.0.2.213", "192.0.2.200" ] } ], "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": "globalaccelerator.amazonaws.com", "eventName": "UpdateListener", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "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": "globalaccelerator.amazonaws.com", "eventName": "DescribeListener", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "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": "globalaccelerator.amazonaws.com", "eventName": "ListListeners", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "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": "globalaccelerator.amazonaws.com", "eventName": "DeleteListener", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "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" } ] }