

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 關於 AWS CodeBuild 日誌檔案項目
<a name="understanding-service-name-entries"></a>

權杖是一種組態，能讓事件以日誌檔案的形式交付至您指定的 S3 儲存貯體。CloudTrail 日誌檔案包含一個或多個日誌項目。一個事件為任何來源提出的單一請求，並包含請求動作、請求的日期和時間、請求參數等資訊。CloudTrail 日誌檔案並非依公有 API 呼叫追蹤記錄的堆疊排序，因此不會以任何特定順序出現。

**注意**  
 為了保護敏感資訊，CodeBuild 日誌中會隱藏下列項目：  
 AWS 存取金鑰 IDs。如需詳細資訊，請參閱*AWS Identity and Access Management 《 使用者指南*》中的[管理 IAM 使用者的存取金鑰](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)。
 使用參數存放區指定的字串。如需詳細資訊，請參閱《*Amazon EC2 Systems Manager 使用者指南*》中的 [Systems Manager 參數存放區](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html)和 [Systems Manager 參數存放區主控台演練](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-walk.html#sysman-paramstore-console)。
 使用 指定的字串 AWS Secrets Manager。如需詳細資訊，請參閱[金鑰管理](security-key-management.md)。

下列範例顯示 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" 
}
```