Dynamodb 简明教程
DynamoDB - CloudTrail
DynamoDB 包括 CloudTrail 集成。它从或为帐户中的 DynamoDB 捕获低级别 API 请求,并将日志文件发送到指定的 S3 存储桶。它针对来自控制台或 API 的调用。您可以使用这些数据来确定请求的来源、用户、时间戳等信息。
DynamoDB includes CloudTrail integration. It captures low-level API requests from or for DynamoDB in an account, and sends log files to a specified S3 bucket. It targets calls from the console or API. You can use this data to determine requests made and their source, user, timestamp, and more.
启用后,它会跟踪包含其他服务记录的日志文件中的动作。它支持八个动作和两个流 -
When enabled, it tracks actions in log files, which include other service records. It supports eight actions and two streams −
八个动作如下 -
The eight actions are as follows −
-
CreateTable
-
DeleteTable
-
DescribeTable
-
ListTables
-
UpdateTable
-
DescribeReservedCapacity
-
DescribeReservedCapacityOfferings
-
PurchaseReservedCapacityOfferings
而两个流如下 -
While, the two streams are −
-
DescribeStream
-
ListStreams
所有日志都包含有关提出请求的帐户的信息。您可以确定详细信息,例如根或 IAM 用户是否提出了请求,或者是否使用了临时凭证或联合凭证。
All the logs contain information about accounts making requests. You can determine detailed information like whether root or IAM users made the request, or whether with temporary credentials or federated.
日志文件会根据您指定的时间长度保留在存储中,并进行归档和删除设置。默认情况下,会创建加密的日志。您可以为新日志设置警报。您还可以在一个存储桶中整理跨区域和帐户的多个日志。
The log files remain in storage for however long you specify, with settings for archiving and deletion. The default creates encrypted logs. You can set alerts for new logs. You can also organize multiple logs, across regions and accounts, into a single bucket.
Interpreting Log Files
每个文件包含一个或多个条目。每个条目由多个 JSON 格式的事件组成。条目表示一个请求,并包含关联信息;不对顺序提供保证。
Each file contains a single or multiple entries. Each entry consists of multiple JSON format events. An entry represents a request, and includes associated information; with no guarantee of order.
您可以查看以下示例日志文件 -
You can review the following sample log file −
{"Records": [
{
"eventVersion": "5.05",
"userIdentity": {
"type": "AssumedRole",
"principalId": "AKTTIOSZODNN8SAMPLE:jane",
"arn": "arn:aws:sts::155522255533:assumed-role/users/jane",
"accountId": "155522255533",
"accessKeyId": "AKTTIOSZODNN8SAMPLE",
"sessionContext": {
"attributes": {
"mfaAuthenticated": "false",
"creationDate": "2016-05-11T19:01:01Z"
},
"sessionIssuer": {
"type": "Role",
"principalId": "AKTTI44ZZ6DHBSAMPLE",
"arn": "arn:aws:iam::499955777666:role/admin-role",
"accountId": "499955777666",
"userName": "jill"
}
}
},
"eventTime": "2016-05-11T14:33:20Z",
"eventSource": "dynamodb.amazonaws.com",
"eventName": "DeleteTable",
"awsRegion": "us-west-2",
"sourceIPAddress": "192.0.2.0",
"userAgent": "console.aws.amazon.com",
"requestParameters": {"tableName": "Tools"},
"responseElements": {"tableDescription": {
"tableName": "Tools",
"itemCount": 0,
"provisionedThroughput": {
"writeCapacityUnits": 25,
"numberOfDecreasesToday": 0,
"readCapacityUnits": 25
},
"tableStatus": "DELETING",
"tableSizeBytes": 0
}},
"requestID": "4D89G7D98GF7G8A7DF78FG89AS7GFSO5AEMVJF66Q9ASUAAJG",
"eventID": "a954451c-c2fc-4561-8aea-7a30ba1fdf52",
"eventType": "AwsApiCall",
"apiVersion": "2013-04-22",
"recipientAccountId": "155522255533"
}
]}