

# S3 Vectors용 AWS CloudTrail을 사용하여 로깅
<a name="s3-vectors-logging"></a>

Amazon S3 Vectors는 사용자, 역할, 또는 AWS 서비스가 수행한 작업에 대한 레코드를 제공하는 서비스인 AWS CloudTrail과 통합됩니다. CloudTrail은 S3 Vectors에 대한 모든 API 직접 호출을 이벤트로 캡처합니다. CloudTrail에서 수집한 정보를 사용하여 S3 Vectors에 전송된 요청, 요청이 이루어진 IP 주소, 요청이 이루어진 시간, 추가 세부 정보를 확인할 수 있습니다. 지원되는 이벤트 활동이 S3 Vectors에서 발생하면 해당 활동이 CloudTrail 이벤트에 기록됩니다. CloudTrail 추적을 사용하여 S3 Vectors에 대한 관리 이벤트 및 데이터 이벤트를 로깅할 수 있습니다.

CloudTrail에 대한 자세한 내용은 [CloudTrail 사용 설명서](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/)를 참조하세요.

## CloudTrail의 S3 Vectors 정보
<a name="s3-vectors-logging-information"></a>

CloudTrail은 계정 생성 시 AWS 계정에서 활성화됩니다. S3 Vectors에서 활동이 발생하면 해당 활동이 이벤트 기록의 다른 AWS 서비스 이벤트와 함께 CloudTrail 이벤트에 기록됩니다. AWS 계정에서 최신 이벤트를 확인, 검색 및 다운로드할 수 있습니다. 자세한 설명은 [CloudTrail 이벤트 기록으로 이벤트 보기](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html)를 참조하세요.

S3 Vectors에 대한 이벤트를 포함하여 AWS 계정에 이벤트를 지속적으로 기록하려면 추적을 생성합니다. 트레일을 통해 CloudTrail은 로그 파일을 Amazon S3 버킷으로 전송할 수 있습니다. 콘솔에서 추적을 생성하면 기본적으로 모든 AWS Region에 추적이 적용됩니다. 추적은 AWS 파티션에 있는 모든 리전의 이벤트를 로깅하고 지정된 Amazon S3 버킷으로 로그 파일을 전송합니다. 또는 CloudTrail 로그에서 수집된 이벤트 데이터를 추가 분석 및 처리하도록 다른 AWS 서비스를 구성할 수 있습니다. 자세한 내용은 *CloudTrail 사용 설명서*의 [Overview for Creating a Trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-and-update-a-trail.html), [Configuring Amazon SNS Notifications for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/getting-notifications-top-level.html), [Receiving CloudTrail Log Files from Multiple Regions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/receive-cloudtrail-log-files-from-multiple-regions.html) 및 [Receiving CloudTrail Log Files from Multiple Accounts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-receive-logs-from-multiple-accounts.html)를 참조하세요.

모든 S3 Vectors API 작업은 CloudTrail에서 로깅되며 [Amazon S3 Vectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_S3_Vectors.html) API 참조에 설명되어 있습니다. 예를 들어 [CreateVectorBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_CreateVectorBucket.html), [CreateIndex](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_CreateIndex.html) 및 [QueryVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_QueryVectors.html) 작업에 대한 직접 호출에서는 CloudTrail 로그 파일에 항목이 생성됩니다.

모든 이벤트 또는 로그 항목에는 요청을 생성했던 사용자에 관한 정보가 포함됩니다. ID 정보를 이용하면 다음을 쉽게 판단할 수 있습니다.
+ 요청을 루트로 했는지 아니면 IAM 사용자 자격 증명 정보로 했는지 여부.
+ 역할 또는 페더레이션 사용자의 임시 자격 증명을 사용하여 요청이 생성되었는지 여부.
+ 다른 AWS 서비스에서 요청했는지.

자세한 내용은 *CloudTrail 사용 설명서*의 [CloudTrail userIdentity 요소](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference-user-identity.html)를 참조하세요.

## S3 Vectors에 대한 CloudTrail 관리 이벤트
<a name="s3-vectors-logging-management-events"></a>

관리 이벤트는 AWS 계정의 리소스에 대해 수행되는 관리 작업에 대한 정보를 제공합니다. 이를 컨트롤 플레인 작업이라고도 합니다. 기본적으로 CloudTrail은 관리 이벤트를 로깅합니다.

S3 Vectors의 경우 CloudTrail은 다음 관리 이벤트를 로깅합니다.
+ [CreateVectorBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_CreateVectorBucket.html)
+ [DeleteVectorBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_DeleteVectorBucket.html)
+ [GetVectorBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_GetVectorBucket.html)
+ [ListVectorBuckets](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_ListVectorBuckets.html)
+ [PutVectorBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_PutVectorBucketPolicy.html)
+ [GetVectorBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_GetVectorBucketPolicy.html)
+ [DeleteVectorBucketPolicy](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_DeleteVectorBucketPolicy.html)
+ [CreateIndex](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_CreateIndex.html)
+ [DeleteIndex](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_DeleteIndex.html)
+ [GetIndex](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_GetIndex.html)
+ [ListIndexes](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_ListIndexes.html)

S3 Vectors 관리 이벤트 및 데이터 이벤트에 대한 `eventSource`는 `s3vectors.amazonaws.com`입니다.

관리 이벤트에 대한 자세한 내용은 *CloudTrail 사용 설명서*의 [Logging management events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html)를 참조하세요.

## S3 Vectors에 대한 CloudTrail 데이터 이벤트
<a name="s3-vectors-logging-data-events"></a>

데이터 이벤트는 리소스 상에서, 또는 리소스 내에서 수행되는 리소스 작업에 대한 정보를 제공합니다. 이를 데이터 플레인 작업이라고도 합니다. 기본적으로 CloudTrail은 데이터 이벤트를 로깅하지 않습니다. 그러나 S3 Vectors 리소스에 대한 데이터 이벤트를 로깅하도록 추적을 구성할 수 있습니다.

데이터 이벤트를 로깅하도록 추적을 구성할 때 S3 Vectors 리소스 유형을 지정할 수 있습니다. S3 Vectors는 데이터 이벤트에 대해 다음과 같은 리소스 유형을 지원합니다.
+ `AWS::S3Vectors::VectorBucket` - 지정된 벡터 버킷의 모든 벡터 인덱스에 대한 데이터 이벤트를 로깅합니다.
+ `AWS::S3Vectors::Index` - 특정 벡터 인덱스에 대한 데이터 이벤트를 로깅합니다.

S3 Vectors의 경우 CloudTrail은 다음 데이터 이벤트를 로깅합니다.

벡터 데이터 작업:
+ [PutVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_PutVectors.html) - 벡터가 벡터 인덱스에 추가될 때 로깅합니다.
+ [GetVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_GetVectors.html) - 벡터 인덱스에서 벡터를 검색할 때 로깅합니다.
+ [DeleteVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_DeleteVectors.html) - 벡터 인덱스에서 벡터가 삭제될 때 로깅됩니다.
+ [ListVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_ListVectors.html) - 벡터 인덱스의 벡터가 나열될 때 로깅됩니다.
+ [QueryVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_QueryVectors.html) - 벡터 인덱스에서 유사성 쿼리가 수행될 때 로깅됩니다.

S3 Vectors 데이터 이벤트에 대한 `eventSource`는 `s3vectors.amazonaws.com`입니다.

## S3 Vectors에 대한 데이터 이벤트 로깅 활성화
<a name="s3-vectors-logging-enabling-data-events"></a>

CloudTrail 추적을 만들거나 업데이트할 때 S3 Vectors 리소스에 대한 데이터 이벤트 로깅을 활성화할 수 있습니다. 계정의 모든 벡터 버킷 및 벡터 인덱스에 대한 로깅을 지정하거나 개별 벡터 버킷 또는 벡터 인덱스를 지정할 수 있습니다. 추적 만들기에 대한 자세한 단계는 *CloudTrail 사용 설명서*의 [Creating a trail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-create-a-trail-using-the-console-first-time.html)을 참조하세요.

모든 S3 Vectors 리소스에 대해 데이터 이벤트 로깅 활성화
+ 추적을 만들거나 업데이트할 때 **데이터 이벤트**를 선택합니다.
+ **리소스 유형**에서 `AWS::S3Vectors::VectorBucket`을 선택합니다.
+ **리소스 ARN**에 `arn:aws:s3vectors:_:_:bucket/*`을 입력하여 모든 벡터 버킷에 대한 이벤트를 로깅하거나 개별 벡터 버킷 ARN(예: `arn:aws:s3vectors:us-east-1:123456789012:bucket/amzn-s3-demo-vector-bucket`)을 지정합니다.

특정 벡터 인덱스에 대한 데이터 이벤트 로깅 활성화
+ 추적을 만들거나 업데이트할 때 **데이터 이벤트**를 선택합니다.
+ **리소스 유형**에서 `AWS::S3Vectors::Index`을 선택합니다.
+ **리소스 ARN**에 `arn:aws:s3vectors:us-east-1:123456789012:bucket/amzn-s3-demo-vector-bucket/index/my-index` 등 특정 벡터 인덱스의 ARN을 입력합니다.

데이터 이벤트에 대한 자세한 내용은 *CloudTrail 사용 설명서*의 [Logging data events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html)를 참조하세요.

**Topics**
+ [CloudTrail의 S3 Vectors 정보](#s3-vectors-logging-information)
+ [S3 Vectors에 대한 CloudTrail 관리 이벤트](#s3-vectors-logging-management-events)
+ [S3 Vectors에 대한 CloudTrail 데이터 이벤트](#s3-vectors-logging-data-events)
+ [S3 Vectors에 대한 데이터 이벤트 로깅 활성화](#s3-vectors-logging-enabling-data-events)
+ [S3 Vectors에 대한 CloudTrail 로그 파일 예제](s3-vectors-cloudtrail-log-example.md)

# S3 Vectors에 대한 CloudTrail 로그 파일 예제
<a name="s3-vectors-cloudtrail-log-example"></a>

다음 예제에서는 S3 Vectors 데이터 이벤트에 대한 CloudTrail 로그 항목을 보여줍니다. 벡터 인덱스 내에서 벡터 데이터에 대한 작업을 수행하면 데이터 이벤트가 로깅됩니다.

## 예제: `GetVectors` 데이터 이벤트에 대한 CloudTrail 로그 파일
<a name="s3-vectors-cloudtrail-getvectors-example"></a>

```
{
    "eventVersion": "1.11",
    "userIdentity": {
        "type": "IAMUser",
        "principalId": "123456789012",
        "arn": "arn:aws:iam::123456789012:user/myUserName",
        "accountId": "123456789012",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
        "userName": "myUserName"
    },
    "eventTime": "2024-11-22T17:12:25Z",
    "eventSource": "s3vectors.amazonaws.com",
    "eventName": "GetVectors",
    "awsRegion": "us-east-1",
    "sourceIPAddress": "192.0.2.0",
    "userAgent": "[aws-cli/2.18.5]",
    "requestParameters": {
        "vectorBucketName": "amzn-s3-demo-vector-bucket",
        "returnMetadata": "false",
        "indexName": "111aa1111-22bb-33cc-44dd-5555eee66ffff",
        "returnData": "false"
    },            
    "responseElements": null,
    "additionalEventData": {
        "SignatureVersion": "SigV4",
        "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256"
    },
    "requestID": "07D681123BD12AED",
    "eventID": "f2b287f3-0df1-1234-a2f4-c4bdfed47657",
    "readOnly": true,
    "resources": [{
        "accountId": "123456789012",
        "type": "AWS::S3Vectors::VectorBucket",
        "ARN": "arn:aws:s3vectors:us-east-1:123456789012:bucket/amzn-s3-demo-vector-bucket"
    }, {
        "accountId": "123456789012",
        "type": "AWS::S3Vectors::Index",
        "ARN": "arn:aws:s3vectors:us-east-1:123456789012:bucket/amzn-s3-demo-vector-bucket/index/111aa1111-22bb-33cc-44dd-5555eee66ffff"
    }],
    "eventType": "AwsApiCall",
    "managementEvent": false,
    "recipientAccountId": "444455556666",
    "eventCategory": "Data",
    "tlsDetails": {
        "tlsVersion": "TLSv1.2",
        "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256",
        "clientProvidedHostHeader": "client-host"
    }
}
```

## S3 Vectors 로그 파일 항목 이해
<a name="s3-vectors-cloudtrail-understanding"></a>

CloudTrail 로그 파일에는 하나 이상의 로그 항목이 포함될 수 있습니다. 이벤트는 모든 소스의 단일 요청을 나타내며 요청된 작업, 작업 날짜와 시간, 요청 파라미터 등에 대한 정보를 포함합니다. CloudTrail 로그 파일은 퍼블릭 API 직접 호출의 주문 스택 트레이스가 아니므로 특정 순서로 표시되지 않습니다.

S3 Vectors CloudTrail 로그 항목에는 다음 주요 요소가 포함됩니다.
+ **eventSource** - S3 Vectors 이벤트에 대해 항상 `s3vectors.amazonaws.com`입니다.
+ **eventName** - 수행된 S3 Vectors API 작업입니다.
+ **eventCategory** - 컨트롤 플레인 작업에 대해 `Management` 또는 데이터 플레인 작업에 대해 `Data`입니다.
+ **readOnly**: 읽기 작업에 대해 `true`(예: [GetVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_GetVectors.html), [QueryVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_QueryVectors.html), [ListVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_ListVectors.html)), 쓰기 작업에 대해 `false`([PutVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_PutVectors.html), [DeleteVectors](https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_DeleteVectors.html)).입니다
+ **리소스** - 벡터 버킷 및 벡터 인덱스를 포함하여 작업에 관련된 S3 Vectors 리소스입니다.
+ **requestParameters** - 요청과 함께 전송된 파라미터입니다.
+ **responseElements** - S3 Vectors 서비스에서 반환하는 응답 요소입니다.