Amazon Simple Workflow Service
Developer Guide (API Version 2012-01-25)

Logging Amazon Simple Workflow Service API Calls with AWS CloudTrail

Amazon SWF is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service in Amazon SWF. CloudTrail captures all API calls for Amazon SWF as events. The calls captured include calls from the Amazon SWF console and code calls to the Amazon SWF API operations. If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for Amazon SWF. 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 Amazon SWF, 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, including how to configure and enable it, see the AWS CloudTrail User Guide.

Amazon SWF Information in CloudTrail

CloudTrail is enabled on your AWS account when you create the account. When supported event activity occurs in Amazon SWF, 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 Amazon SWF, 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 AWS 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:

Amazon SWF supports logging the following actions as events in 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.

Example: Amazon SWF 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.


Here is an example of a CloudTrail log for DeprecateActivityType:

{ "eventVersion": "1.01", "eventID": "0f65b038-58ff-4d26-b1c7-eedff8db994b", "eventTime": "2014-05-07T22:45:36Z", "requestParameters": { "domain": "swf-example-domain", "activityType": { "version": "1.0", "name": "swf-example-activityType" } }, "responseElements": null, "awsRegion": "us-east-1", "eventName": "DeprecateActivityType", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "type": "Root", "arn": "arn:aws:iam::244806523816:root", "principalId": "244806523816", "accountId": "244806523816" }, "eventSource": "", "requestID": "4e1a8e94-d639-11e3-9a1c-4dbc5d9f1a49", "userAgent": "aws-sdk-java/unknown-version Linux/2.6.18-164.el5 Java_HotSpot(TM)_64-Bit_Server_VM/24.45-b08", "sourceIPAddress": "" }


Here is an example of a CloudTrail log for DeprecateDomain:

{ "eventVersion": "1.01", "eventID": "a2be5766-3d3a-4bd3-8b88-4f3582cb52bc", "eventTime": "2014-05-07T22:46:00Z", "requestParameters": { "name": "swf-example-domain" }, "responseElements": null, "awsRegion": "us-east-1", "eventName": "DeprecateDomain", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "type": "Root", "arn": "arn:aws:iam::244806523816:root", "principalId": "244806523816", "accountId": "244806523816" }, "eventSource": "", "requestID": "5c95ae06-d639-11e3-8836-a37995ed01ed", "userAgent": "aws-sdk-java/unknown-version Linux/2.6.18-164.el5 Java_HotSpot(TM)_64-Bit_Server_VM/24.45-b08", "sourceIPAddress": "" }


Here is an example of a CloudTrail log for DeprecateWorkflowType:

{ "eventVersion": "1.01", "eventID": "ff6f4e8e-2401-4c1a-956a-f36dab55b22b", "eventTime": "2014-05-07T22:45:36Z", "requestParameters": { "domain": "swf-example-domain", "workflowType": { "version": "1.0", "name": "swf-example-workflowType" } }, "responseElements": null, "awsRegion": "us-east-1", "eventName": "DeprecateWorkflowType", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "type": "Root", "arn": "arn:aws:iam::244806523816:root", "principalId": "244806523816", "accountId": "244806523816" }, "eventSource": "", "requestID": "4df29420-d639-11e3-8836-a37995ed01ed", "userAgent": "aws-sdk-java/unknown-version Linux/2.6.18-164.el5 Java_HotSpot(TM)_64-Bit_Server_VM/24.45-b08", "sourceIPAddress": "" }


Here is an example of a CloudTrail log for RegisterActivityType:

{ "eventVersion": "1.01", "eventID": "d4a99e9e-a980-4e7a-9d84-7b00806ab70f", "eventTime": "2014-05-07T22:03:38Z", "requestParameters": { "domain": "swf-example-domain", "defaultTaskScheduleToStartTimeout": "60", "name": "swf-example-activityType", "defaultTaskStartToCloseTimeout": "120", "defaultTaskScheduleToCloseTimeout": "180", "version": "1.0", "defaultTaskList": { "name": "swf-tasklist" }, "description": "integration test" }, "responseElements": null, "awsRegion": "us-east-1", "eventName": "RegisterActivityType", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "type": "Root", "arn": "arn:aws:iam::244806523816:root", "principalId": "244806523816", "accountId": "244806523816" }, "eventSource": "", "requestID": "71811de3-d633-11e3-accd-9dbdf860ac2b", "userAgent": "aws-sdk-java/unknown-version Linux/2.6.18-164.el5 Java_HotSpot(TM)_64-Bit_Server_VM/24.45-b08", "sourceIPAddress": "" }


Here is an example of a CloudTrail log for RegisterDomain:

{ "eventVersion": "1.01", "eventID": "e7e3c104-e748-4eda-90b5-827d44f4e459", "eventTime": "2014-05-07T22:03:38Z", "requestParameters": { "name": "swf-example-domain", "workflowExecutionRetentionPeriodInDays": "7", "description": "integration test domain" }, "responseElements": null, "awsRegion": "us-east-1", "eventName": "RegisterDomain", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "type": "Root", "arn": "arn:aws:iam::244806523816:root", "principalId": "244806523816", "accountId": "244806523816" }, "eventSource": "", "requestID": "7133729f-d633-11e3-860e-45859b92f1b2", "userAgent": "aws-sdk-java/unknown-version Linux/2.6.18-164.el5 Java_HotSpot(TM)_64-Bit_Server_VM/24.45-b08", "sourceIPAddress": "" }


Here is an example of a CloudTrail log for RegisterWorkflowType:

{ "eventVersion": "1.01", "eventID": "31d2b900-a0c1-41a9-a09b-d5c8a57087eb", "eventTime": "2014-05-07T22:03:38Z", "requestParameters": { "defaultExecutionStartToCloseTimeout": "180", "domain": "swf-example-domain", "name": "swf-example-workflowType", "defaultChildPolicy": "TERMINATE", "defaultTaskStartToCloseTimeout": "NONE", "version": "1.0", "defaultTaskList": { "name": "swf-tasklist" } }, "responseElements": null, "awsRegion": "us-east-1", "eventName": "RegisterWorkflowType", "userIdentity": { "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "type": "Root", "arn": "arn:aws:iam::244806523816:root", "principalId": "244806523816", "accountId": "244806523816" }, "eventSource": "", "requestID": "71577518-d633-11e3-842e-67638fa0222f", "userAgent": "aws-sdk-java/unknown-version Linux/2.6.18-164.el5 Java_HotSpot(TM)_64-Bit_Server_VM/24.45-b08", "sourceIPAddress": "" }