

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# を使用した Amazon GameLift Streams API コールのログ記録 AWS CloudTrail
<a name="logging-using-cloudtrail"></a>

Amazon GameLift Streams は、ユーザー[AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)、ロール、または によって実行されたアクションを記録するサービスである と統合されています AWS のサービス。CloudTrail は、Amazon GameLift Streams のすべての API コールをイベントとしてキャプチャします。キャプチャされた呼び出しには、Amazon GameLift Streams コンソールからの呼び出しと、Amazon GameLift Streams API オペレーションへのコード呼び出しが含まれます。CloudTrail で収集された情報を使用して、Amazon GameLift Streams に対するリクエスト、リクエスト元の IP アドレス、リクエスト日時などの詳細を確認できます。

各イベントまたはログエントリには、誰がリクエストを生成したかという情報が含まれます。アイデンティティ情報は、以下を判別するのに役立ちます。
+ ルートユーザーまたはユーザー認証情報のどちらを使用してリクエストが送信されたか。
+ リクエストが IAM Identity Center ユーザーに代わって行われたかどうか。
+ リクエストがロールまたはフェデレーションユーザーのテンポラリなセキュリティ認証情報を使用して行われたかどうか。
+ リクエストが、別の AWS のサービスによって送信されたかどうか。

CloudTrail は、アカウントを作成する AWS アカウント と でアクティブになり、CloudTrail **イベント履歴**に自動的にアクセスできます。CloudTrail の **[イベント履歴]** では、 AWS リージョンで過去 90 日間に記録された 管理イベントの表示、検索、およびダウンロードが可能で、変更不可能な記録を確認できます。詳細については、「*AWS CloudTrail ユーザーガイド*」の「[CloudTrail イベント履歴の使用](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)」を参照してください。**[イベント履歴]** の閲覧には CloudTrail の料金はかかりません。

 AWS アカウント 過去 90 日間のイベントの継続的な記録については、証跡または [CloudTrail Lake](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html) イベントデータストアを作成します。

**CloudTrail 証跡**  
*証跡*により、CloudTrail はログファイルを Amazon S3 バケットに配信できます。を使用して作成されたすべての証跡 AWS マネジメントコンソール はマルチリージョンです。 AWS CLIを使用する際は、単一リージョンまたは複数リージョンの証跡を作成できます。アカウント AWS リージョン 内のすべての でアクティビティをキャプチャするため、マルチリージョン証跡を作成することをお勧めします。単一リージョンの証跡を作成する場合、証跡の AWS リージョンに記録されたイベントのみを表示できます。証跡の詳細については、「*AWS CloudTrail ユーザーガイド*」の「[AWS アカウントの証跡の作成](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html)」および「[組織の証跡の作成](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html)」を参照してください。  
証跡を作成すると、進行中の管理イベントのコピーを 1 つ無料で CloudTrail から Amazon S3 バケットに配信できますが、Amazon S3 ストレージには料金がかかります。CloudTrail の料金の詳細については、「[AWS CloudTrail の料金](https://aws.amazon.com/cloudtrail/pricing/)」を参照してください。Amazon S3 の料金に関する詳細については、「[Amazon S3 の料金](https://aws.amazon.com/s3/pricing/)」を参照してください。

**CloudTrail Lake イベントデータストア**  
*[CloudTrail Lake]* を使用すると、イベントに対して SQL ベースのクエリを実行できます。CloudTrail Lake は、行ベースの JSON 形式の既存のイベントを [Apache ORC](https://orc.apache.org/) 形式に変換します。ORC は、データを高速に取得するために最適化された単票ストレージ形式です。イベントは、*イベントデータストア*に集約されます。イベントデータストアは、[高度なイベントセレクタ](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-concepts.html#adv-event-selectors)を適用することによって選択する条件に基づいた、イベントのイミュータブルなコレクションです。どのイベントが存続し、クエリに使用できるかは、イベントデータストアに適用するセレクタが制御します。CloudTrail Lake の詳細については、 *AWS CloudTrail ユーザーガイド*の[AWS CloudTrail 「Lake の使用](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake.html)」を参照してください。  
CloudTrail Lake のイベントデータストアとクエリにはコストがかかります。イベントデータストアを作成する際に、イベントデータストアに使用する[料金オプション](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html#cloudtrail-lake-manage-costs-pricing-option)を選択します。料金オプションによって、イベントの取り込みと保存にかかる料金、および、そのイベントデータストアのデフォルトと最長の保持期間が決まります。CloudTrail の料金の詳細については、「[AWS CloudTrail の料金](https://aws.amazon.com/cloudtrail/pricing/)」を参照してください。

## CloudTrail で Amazon GameLift Streams データイベント
<a name="cloudtrail-data-events"></a>

[データイベント](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#logging-data-events)は、リソースで、またはリソースで実行されるリソースオペレーションに関する情報を提供します (ストリームグループでストリームセッションを開始するなど）。これらのイベントは、データプレーンオペレーションとも呼ばれます。データイベントは、多くの場合、高ボリュームのアクティビティです。デフォルトでは、CloudTrail はデータイベントをログ記録しません。CloudTrail **[イベント履歴]** にはデータイベントは記録されません。

追加の変更がイベントデータに適用されます。CloudTrail の料金の詳細については、「[AWS CloudTrail の料金](https://aws.amazon.com/cloudtrail/pricing/)」を参照してください。

CloudTrail コンソール、または CloudTrail CloudTrail API オペレーションを使用して AWS CLI、Amazon GameLift Streams リソースタイプのデータイベントを記録できます。データイベントをログに記録する方法の詳細については、「*AWS CloudTrail ユーザーガイド*」の「[AWS マネジメントコンソールを使用したデータイベントのログ記録](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#logging-data-events-console)」および「[AWS Command Line Interfaceを使用したデータイベントのログ記録](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-with-the-AWS-CLI)」を参照してください。

次の表に、データイベントを記録できる Amazon GameLift Streams リソースタイプを示します。**リソースタイプ (コンソール)** 列には、CloudTrail コンソールの **[リソースタイプ]** リストから選択する値が表示されます。**resources.type 値**列には、 AWS CLI または CloudTrail APIs を使用して高度なイベントセレクタを設定するときに指定する `resources.type`値が表示されます。**CloudTrail に記録されたデータ API** 列には、リソース タイプの CloudTrail にログ記録された API コールが表示されます。


| リソースタイプ (コンソール) | resources.type 値 | CloudTrail にログ記録されたデータ API | 
| --- | --- | --- | 
| GameLift Streams アプリケーション |  AWS::GameLiftStreams::Application  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/gameliftstreams/latest/developerguide/logging-using-cloudtrail.html)  | 
| GameLift Streams ストリームグループ |  AWS::GameLiftStreams::StreamGroup  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ja_jp/gameliftstreams/latest/developerguide/logging-using-cloudtrail.html)  | 

`eventName`、`readOnly`、および `resources.ARN` フィールドでフィルタリングして、自分にとって重要なイベントのみをログに記録するように高度なイベントセレクタを設定できます。オブジェクトの詳細については、「*AWS CloudTrail API リファレンス*」の「[https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html)」を参照してください。

## CloudTrail での Amazon GameLift Streams 管理イベント
<a name="cloudtrail-management-events"></a>

[管理イベント](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html#logging-management-events)は、 のリソースで実行される管理オペレーションに関する情報を提供します AWS アカウント。これらのイベントは、コントロールプレーンオペレーションとも呼ばれます。CloudTrail は、デフォルトで管理イベントをログ記録します。

Amazon GameLift Streams は、次の Amazon GameLift Streams コントロールプレーンオペレーション*を管理イベント*として CloudTrail に記録します。
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AddStreamGroupLocations.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AddStreamGroupLocations.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AssociateApplications.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AssociateApplications.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_CreateApplication.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_CreateApplication.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_CreateStreamGroup.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_CreateStreamGroup.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DeleteApplication.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DeleteApplication.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DeleteStreamGroup.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DeleteStreamGroup.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DisassociateApplications.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DisassociateApplications.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetApplication.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetApplication.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetStreamGroup.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetStreamGroup.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_ListApplications.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_ListApplications.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_ListStreamGroups.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_ListStreamGroups.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_ListTagsForResource.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_ListTagsForResource.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_RemoveStreamGroupLocations.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_RemoveStreamGroupLocations.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_TagResource.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_TagResource.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UntagResource.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UntagResource.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UpdateApplication.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UpdateApplication.html)
+ [https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UpdateStreamGroup.html](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UpdateStreamGroup.html)

## Amazon GameLift Streams イベントの例
<a name="cloudtrail-event-examples"></a>

各イベントは任意の送信元からの単一のリクエストを表し、リクエストされた API オペレーション、オペレーションの日時、リクエストパラメータなどに関する情報を含みます。CloudTrail ログファイルは、パブリック API コールの順序付けられたスタックトレースではないため、イベントは特定の順序で表示されません。

次の例は、CreateApplication オペレーションを示す CloudTrail 管理イベントを示しています。 [CreateApplication](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_CreateApplication.html) 

```
{
      "eventVersion": "1.09",
      "userIdentity": {
         "type": "AssumedRole",
         "principalId": "AROA123456789EXAMPLE:assume-temporary-gameliftstreams-access-role",
         "arn": "arn:aws:sts::111122223333:assumed-role/GameLiftStreamsTestRole/assume-temporary-gameliftstreams-access-role",
         "accountId": "111122223333",
         "accessKeyId": "ASIAIOSFODNN7EXAMPLE",
         "sessionContext": {
               "sessionIssuer": {
                  "type": "Role",
                  "principalId": "AROA123456789EXAMPLE",
                  "arn": "arn:aws:iam::111122223333:role/GameLiftStreamsTestRole",
                  "accountId": "111122223333",
                  "userName": "GameLiftStreamsTestRole"
               },
               "webIdFederationData": {},
               "attributes": {
                  "creationDate": "2025-07-23T21:18:19Z",
                  "mfaAuthenticated": "false"
               }
         }
      },
      "eventTime": "2025-07-23T21:58:54Z",
      "eventSource": "gameliftstreams.amazonaws.com",
      "eventName": "CreateApplication",
      "awsRegion": "us-west-2",
      "sourceIPAddress": "203.0.113.0",
      "userAgent": "aws-sdk-javascript/2.0.0 Linux/4.14.291-218.527.amzn2.x86_64 OpenJDK_64-Bit_Server_VM/11.0.17+9-LTS Java/11.0.17 vendor/Amazon.com_Inc. exec-env/AWS_ECS_FARGATE io/sync http/Apache cfg/retry-mode/legacy",
      "requestParameters": {
         "ApplicationSourceUri": "s3://amzn-s3-demo-bucket/MyGame",
         "Description": "MyGame canary - Proton 8",
         "RuntimeEnvironment": {
               "Type": "PROTON",
               "Version": "20230704"
         },
         "ClientToken": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
         "ExecutablePath": "MyGame100.exe"
      },
      "responseElements": {
         "Status": "INITIALIZED",
         "ApplicationSourceUri": "s3://amzn-s3-demo-bucket/MyGame",
         "Description": "MyGame canary - Proton 8",
         "RuntimeEnvironment": {
               "Type": "PROTON",
               "Version": "20230704"
         },
         "LastUpdatedAt": 1753307934.293,
         "CreatedAt": 1753307934.293,
         "Id": "a-9ZY8X7Wv6",
         "Arn": "arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6",
         "ExecutablePath": "MyGame100.exe"
      },
      "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
      "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEbbbbb",
      "readOnly": false,
      "eventType": "AwsApiCall",
      "managementEvent": true,
      "recipientAccountId": "111122223333",
      "eventCategory": "Management"
}
```

次の例は、[StartStreamSession](https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_StartStreamSession.html) オペレーションを示す証跡ログからの CloudTrail データイベントを示しています。

```
{
    "Records": [
        {
            "eventVersion": "1.09",
            "userIdentity": {
                "type": "AssumedRole",
                "principalId": "AROA123456789EXAMPLE:assume-temporary-gameliftstreams-access-role",
                "arn": "arn:aws:sts::111122223333:assumed-role/GameLiftStreamsTestRole/assume-temporary-gameliftstreams-access-role",
                "accountId": "111122223333",
                "accessKeyId": "ASIAIOSFODNN7EXAMPLE",
                "sessionContext": {
                    "sessionIssuer": {
                        "type": "Role",
                        "principalId": "AROA123456789EXAMPLE",
                        "arn": "arn:aws:iam::111122223333:role/GameLiftStreamsTestRole",
                        "accountId": "111122223333",
                        "userName": "GameLiftStreamsTestRole"
                    },
                    "attributes": {
                        "creationDate": "2025-07-23T21:18:19Z",
                        "mfaAuthenticated": "false"
                    }
                }
            },
            "eventTime": "2025-07-23T23:43:46Z",
            "eventSource": "gameliftstreams.amazonaws.com",
            "eventName": "StartStreamSession",
            "awsRegion": "us-east-2",
            "sourceIPAddress": "203.0.113.0",
            "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
            "requestParameters": {
                "Identifier": "sg-1AB2C3De4",
                "Description": "StreamGroup sg-1AB2C3De4 Application a-9ZY8X7Wv6 Console stream",
                "AdditionalLaunchArgs": [],
                "UserId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
                "Locations": [
                    "us-east-2"
                ],
                "SignalRequest": "***",
                "Protocol": "WebRTC",
                "ApplicationIdentifier": "a-9ZY8X7Wv6",
                "ClientToken": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
                "ConnectionTimeoutSeconds": 100,
                "AdditionalEnvironmentVariables": {}
            },
            "responseElements": {
                "Status": "ACTIVATING",
                "ApplicationArn": "arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6",
                "Description": "StreamGroup sg-1AB2C3De4 Application a-9ZY8X7Wv6 Console stream",
                "LastUpdatedAt": 1.753314225925E9,
                "CreatedAt": 1.753314225925E9,
                "AdditionalEnvironmentVariables": {},
                "ConnectionTimeoutSeconds": 100,
                "AdditionalLaunchArgs": [],
                "StreamGroupId": "sg-1AB2C3De4",
                "UserId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
                "SessionLengthSeconds": 43200,
                "SignalRequest": "***",
                "Arn": "arn:aws:gameliftstreams:us-west-2:111122223333:streamsession/sg-1AB2C3De4/ABC123def4567",
                "Protocol": "WebRTC",
                "WebSdkProtocolUrl": "https://123456789012.cloudfront.net/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.js"
            },
            "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa",
            "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEbbbbb",
            "readOnly": false,
            "resources": [
                {
                    "accountId": "111122223333",
                    "type": "AWS::GameLiftStreams::StreamGroup",
                    "ARN": "arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4"
                },
                {
                    "accountId": "111122223333",
                    "type": "AWS::GameLiftStreams::Application",
                    "ARN": "arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6"
                }
            ],
            "eventType": "AwsApiCall",
            "managementEvent": false,
            "recipientAccountId": "111122223333",
            "eventCategory": "Data"
        }
    ]
}
```

CloudTrail レコードの内容については、「*AWS CloudTrail ユーザーガイド*」の「[CloudTrail record contents](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-record-contents.html)」を参照してください。