使用记录 Amazon Simple Workflow Service API 调用Amazon CloudTrail - Amazon Simple Workflow Service
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用记录 Amazon Simple Workflow Service API 调用Amazon CloudTrail

Amazon SWF 与Amazon CloudTrail,该服务提供用户、角色或Amazon服 Amazon SWF。CloudTrail 将 Amazon SWF 的所有 API 调用作为事件捕获。捕获的调用包含来自 Amazon SWF 控制台的调用和对 Amazon SWF API 操作的代码调用。如果您创建跟踪,则可以使 CloudTrail 事件持续传送到 Amazon S3 存储桶(包括 Amazon SWF 的事件)。如果您不配置跟踪,则仍可在 CloudTrail 控制台的 Event history (事件历史记录) 中查看最新事件。使用 CloudTrail 收集的信息,您可以确定向 Amazon SWF 发出了什么请求、发出请求的 IP 地址、何人发出的请求、何人发出的请求、何人发出的请求、何人发出的请求、何人发出的请求、何人发出的请求、发出请求、何人发出

要了解有关 CloudTrail 的更多信息(包括如何对其进行配置和启用),请参阅Amazon CloudTrail用户指南

CloudTrail 中的 Amazon SWF 信息

CloudTrail 已启用Amazon帐户创建账户时,即可使用。当 Amazon SWF 中发生受支持的事件活动时,该活动将记录在 CloudTrail 事件中,并与其他Amazon中的服务事件事件历史记录。您可以在 Amazon 账户中查看、搜索和下载最新事件。有关更多信息,请参阅使用 CloudTrail 事件历史记录查看事件

要持续记录的事件Amazon帐户(包括 Amazon SWF 的事件),请创建跟踪。通过 trail (跟踪),CloudTrail 可将日志文件传送至 Amazon S3 存储桶。默认情况下,在控制台中创建跟踪时,此跟踪应用于所有 Amazon 区域。此跟踪将记录在Amazon分区,并将日志文件传送到您指定的 Amazon S3 存储桶。此外,您还可以配置其他Amazon服务,进一步分析在 CloudTrail 日志中收集的事件数据并采取操作。有关更多信息,请参阅下列内容:

Amazon SWF 支持在 CloudTrail 日志文件中将以下操作记录为事件:

每个事件或日志条目都包含有关生成请求的人员信息。身份信息可帮助您确定以下内容:

  • 请求是使用根用户凭证还是 Amazon Identity and Access Management (IAM) 用户凭证发出的.

  • 请求是使用角色还是联合身份用户的临时安全凭证发出的。

  • 请求是否由其他 Amazon 服务发出。

有关更多信息,请参阅 CloudTrail userIdentity 元素

示例:Amazon SWF 日志文件条目条目

跟踪是一种配置,可用于将事件作为日志文件传送到您指定的 Amazon S3 存储桶。CloudTrail 日志文件包含一个或多个日志条目。一个事件表示来自任何源的一个请求,包括有关请求的操作、操作的日期和时间、请求参数等方面的信息。CloudTrail 日志文件不是公用 API 调用的有序堆栈跟踪,因此它们不会按任何特定顺序显示。

DeprecateActivityType

下面是 DeprecateActivityCloudTrail 日志的示例:

{ "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": "swf.amazonaws.com", "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": "10.61.88.189" }

DeprecateDomain

下面是 DeprecateDomain 的 CloudTrail 日志的示例:

{ "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": "swf.amazonaws.com", "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": "10.61.88.189" }

DeprecateWorkflowType

下面是 DeprecateWorkflowType 的 CloudTrail 日志的示例:

{ "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": "swf.amazonaws.com", "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": "10.61.88.189" }

RegisterActivityType

下面是 RegisterActivityTCloudTrail 日志的示例:

{ "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": "swf.amazonaws.com", "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": "10.61.88.189" }

RegisterDomain

下面是 RegisterDomain 的 CloudTrail 日志的示例:

{ "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": "swf.amazonaws.com", "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": "10.61.88.189" }

RegisterWorkflowType

下面是 RegisterWorkflowType 的 CloudTrail 日志的示例:

{ "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": "swf.amazonaws.com", "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": "10.61.88.189" }