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 captures API calls made by or on behalf of Amazon SWF and delivers the log files to an Amazon S3 bucket that you specify. The API calls can be made indirectly by using the Amazon SWF console or directly by using the Amazon SWF API. Using the information collected by CloudTrail, you can determine what request was made to Amazon SWF, the source IP address from which the request was made, who made the request, when it was made, and so on. To learn more about CloudTrail, including how to configure and enable it, see the AWS CloudTrail User Guide.

Amazon SWF Information in CloudTrail

When CloudTrail logging is enabled, calls made to Amazon SWF actions are tracked in log files. Amazon SWF records are written together with any other AWS service records in a log file. CloudTrail determines when to create and write to a new file based on a specified time period and file size.

The following actions are supported:

Every log entry contains information about who generated the request. The user identity information in the log helps you determine whether the request was made with root or IAM user credentials, with temporary security credentials for a role or federated user, or by another AWS service. For more information, see the userIdentity element in the CloudTrail Event Reference.

You can store your log files in your bucket for as long as you want, but you can also define Amazon S3 lifecycle rules to archive or delete log files automatically. By default, your log files are encrypted using Amazon S3 server-side encryption.

You can choose to have CloudTrail publish Amazon SNS notifications when new log files are delivered if you want to take quick action upon log file delivery. For more information, see Configuring Amazon SNS Notifications.

You can also aggregate log files from multiple AWS regions and multiple AWS accounts into a single Amazon S3 bucket. For more information, see Aggregating CloudTrail Log Files to a Single Amazon S3 Bucket.

Example Amazon SWF Log File Entries

CloudTrail log files can contain one or more log entries where each entry is made up of multiple JSON-formatted events. A log entry represents a single request from any source and includes information about the requested action, any parameters, the date and time of the action, and so on. The log entries are not guaranteed to be in any particular order. That is, they are not an ordered stack trace of the public API calls.


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": "" }