Logging zonal shift API calls using Amazon CloudTrail - Amazon Application Recovery Controller (ARC)
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Logging zonal shift API calls using Amazon CloudTrail

Zonal shift for ARC is integrated with Amazon CloudTrail, a service that provides a record of actions taken by a user, role, or an Amazon service in ARC. CloudTrail captures all API calls for zonal shift as events. The calls captured include calls from the ARC console and code calls to the ARC API operations for zonal shift.

If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for zonal shift. 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 ARC for zonal shift, 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 Amazon CloudTrail User Guide.

Zonal shift information in CloudTrail

CloudTrail is enabled on your Amazon Web Services account when you create the account. When activity occurs in ARC for zonal shift, that activity is recorded in a CloudTrail event along with other Amazon service events in Event history. You can view, search, and download recent events in your Amazon Web Services account. For more information, see Working with CloudTrail Event history.

For an ongoing record of events in your Amazon Web Services account, including events for zonal shift in ARC, 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 Amazon Web Services Regions. The trail logs events from all Regions in the Amazon partition and delivers the log files to the Amazon S3 bucket that you specify. Additionally, you can configure other Amazon services, to further analyze and act upon the event data collected in CloudTrail logs. For more information, see the following:

All ARC actions are logged by CloudTrail and are documented in the Routing Control API Reference Guide for Amazon Application Recovery Controller. For example, calls to the StartZonalShift and ListManagedResources 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 the following:

  • Whether the request was made with root or Amazon 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 Amazon service.

For more information, see the CloudTrail userIdentity element.

Viewing ARC events in event history

CloudTrail lets you view recent events in Event history. For more information, see Working with CloudTrail Event history in the Amazon CloudTrail User Guide.

Understanding zonal shift log file entries

A trail is a configuration that enables delivery of events as log files to an Amazon S3 bucket that you specify. CloudTrail log files contain one or more log entries. An event represents a single request from any source and 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 ListManagedResources action for zonal shift.

{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:role/admin", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AROA33L3W36EXAMPLE", "arn": "arn:aws:iam::111122223333:role/admin", "accountId": "111122223333", "userName": "EXAMPLENAME" }, "webIdFederationData": {}, "attributes": { "creationDate": "2022-11-14T16:01:51Z", "mfaAuthenticated": "false" } } }, "eventTime": "2022-11-14T16:14:41Z", "eventSource": "arc-zonal-shift.amazonaws.com", "eventName": "ListManagedResources", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "userAgent": "Boto3/1.17.101 Python/3.8.10 Linux/4.14.231-180.360.amzn2.x86_64 exec-env/AWS_Lambda_python3.8 Botocore/1.20.102", "requestParameters": null, "responseElements": null, "requestID": "VGXG4ZUE7UZTVCMTJGIAF_EXAMPLE", "eventID": "4b5c42df-1174-46c8-be99-d67_EXAMPLE", "readOnly": true, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333" "eventCategory": "Management" } }

The following example shows a CloudTrail log entry that demonstrates the StartZonalShift action with a conflict exception for zonal shift.

{ "eventVersion": "1.08", "userIdentity": { "type": "AssumedRole", "principalId": "A1B2C3D4E5F6G7EXAMPLE", "arn": "arn:aws:iam::111122223333:role/admin", "accountId": "111122223333", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AROA33L3W36EXAMPLE", "arn": "arn:aws:iam::111122223333:role/admin", "accountId": "111122223333", "userName": "EXAMPLENAME" }, "webIdFederationData": {}, "attributes": { "creationDate": "2022-11-14T16:01:51Z", "mfaAuthenticated": "false" } } }, "eventTime": "2022-11-14T16:10:38Z", "eventSource": "arc-zonal-shift.amazonaws.com", "eventName": "StartZonalShift", "awsRegion": "us-west-2", "sourceIPAddress": "192.0.2.50", "userAgent": "Boto3/1.17.101 Python/3.8.10 Linux/4.14.231-180.360.amzn2.x86_64 exec-env/AWS_Lambda_python3.8 Botocore/1.20.102", "errorCode": "ConflictException", "errorMessage": "There's already an active zonal shift for that resource identifier: 'arn:aws:testservice:us-west-2:077059137270:testResource/456apples'. Active zonal shift: 'bac23b74-176e-c073-de8f-484ca508910f'", "requestParameters": { "resourceIdentifier": "arn:aws:testservice:us-west-2:077059137270:testResource/456apples", "awayFrom": "usw2-az1", "expiresIn": "2m", "comment": "HIDDEN_FOR_SECURITY_REASONS" }, "responseElements": null, "requestID": "OP4OYXZ54HUPMIPGWH_EXAMPLE", "eventID": "0bca6660-e999-43a5-9008-EXAMPLE", "readOnly": false, "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "111122223333" "eventCategory": "Management" } }