本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
关于 AWS CodeBuild 日志文件条目
跟踪是一种配置,允许将事件作为日志文件传输到您指定的 S3 存储桶。 CloudTrail 日志文件包含一个或多个日志条目。事件代表来自任何来源的单个请求,包括有关请求的操作、操作的日期和时间、请求参数等的信息。 CloudTrail 日志文件不是公共API调用的有序堆栈跟踪,因此它们不会按任何特定的顺序出现。
注意
为了保护敏感信息, CodeBuild 日志中隐藏了以下内容:
-
AWS 访问密钥IDs。有关更多信息,请参阅《用户指南》中的 “AWS Identity and Access Management 管理IAM用户的访问密钥”。
-
使用参数存储指定的字符串。有关更多信息,请参阅《亚马逊系统管理器用户指南》中的 Systems Manager 参数存储和 Sy EC2 stems Manager 参数存储控制台演练。
-
使用指定的字符串 AWS Secrets Manager。有关更多信息,请参阅 密钥管理。
以下示例显示了一个 CloudTrail 日志条目,该条目演示了在中创建构建项目 CodeBuild。
{ "eventVersion": "1.05", "userIdentity": { "type": "FederatedUser", "principalId": "
account-ID
:user-name
", "arn": "arn:aws:sts::account-ID
:federated-user/user-name
", "accountId": "account-ID
", "accessKeyId": "access-key-ID
", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2016-09-06T17:59:10Z" }, "sessionIssuer": { "type": "IAMUser", "principalId": "access-key-ID
", "arn": "arn:aws:iam::account-ID
:user/user-name
", "accountId": "account-ID
", "userName": "user-name
" } } }, "eventTime": "2016-09-06T17:59:11Z", "eventSource": "codebuild.amazonaws.com", "eventName": "CreateProject", "awsRegion": "region-ID
", "sourceIPAddress": "127.0.0.1", "userAgent": "user-agent
", "requestParameters": { "awsActId": "account-ID
" }, "responseElements": { "project": { "environment": { "image": "image-ID", "computeType": "BUILD_GENERAL1_SMALL", "type": "LINUX_CONTAINER", "environmentVariables": [] }, "name": "codebuild-demo-project", "description": "This is my demo project", "arn": "arn:aws:codebuild:region-ID
:account-ID
:project/codebuild-demo-project:project-ID
", "encryptionKey": "arn:aws:kms:region-ID
:key-ID
", "timeoutInMinutes": 10, "artifacts": { "location": "arn:aws:s3:::codebuild-region-ID
-account-ID
-output-bucket", "type": "S3", "packaging": "ZIP", "outputName": "MyOutputArtifact.zip" }, "serviceRole": "arn:aws:iam::account-ID
:role/CodeBuildServiceRole", "lastModified": "Sep 6, 2016 10:59:11 AM", "source": { "type": "GITHUB", "location": "https://github.com/my-repo.git" }, "created": "Sep 6, 2016 10:59:11 AM" } }, "requestID": "9d32b228-745b-11e6-98bb-23b67EXAMPLE", "eventID": "581f7dd1-8d2e-40b0-aeee-0dbf7EXAMPLE", "eventType": "AwsApiCall", "recipientAccountId": "account-ID
" }