

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

# Amazon ECS 的 Fargate 任務暫時性儲存
<a name="fargate-task-storage"></a>

佈建時，在 上託管在 Linux 容器上的每個 Amazon ECS 任務都會 AWS Fargate 收到下列暫時性儲存體，用於綁定掛載。這可以在任務定義中使用 `volumes`、`mountPoints` 和 `volumesFrom` 參數的容器之間進行掛載和共用。上的 Windows 容器不支援此項目 AWS Fargate。

## Fargate Linux 容器平台版本
<a name="fargate-task-storage-linux-pv"></a>

### 1.4.0 版或更新版本
<a name="fargate-task-storage-pv14"></a>

依預設，使用平台版本 `1.4.0` 或更新版本的託管於 Fargate 上的所有 Amazon ECS 任務都會收到至少 20 GiB 的暫時性儲存。暫時性儲存的總量可以增加，最多可達 200 GiB。您可在任務定義中指定 `ephemeralStorage` 參數來實現這一操作。

任務的提取、壓縮和未壓縮容器映像會存放在暫時性儲存體中。若要判斷您的任務必須使用的暫時性儲存總量，您必須從為任務配置的暫時性儲存總量中減去容器映像使用的儲存量。

對於 2020 年 5 月 28 日或之後啟動並使用平台版本 `1.4.0` 或更新版本的任務，會使用 AES-256 加密演算法來加密暫時性儲存。此演算法使用 AWS 擁有的加密金鑰，或者您可以建立自己的客戶受管金鑰。如需詳細資訊，請參閱[AWS Fargate 暫時性儲存的客戶受管金鑰](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-storage-encryption.html)。

若任務使用 2022 年 11 月 18 日或之後啟動的平台版本 `1.4.0` 或更高版本，暫時性儲存使用量會透過任務中繼資料端點回報。任務中的應用程式可以查詢任務中繼資料端點版本 4，以取得其暫時性儲存保留大小和使用量。

 此外，如果您開啟 Amazon CloudWatch Container Insights，暫時性儲存預留大小和使用量會傳送至 Container Insights。

**注意**  
Fargate 會在磁盤上保留空間。此空間僅由 Fargate 使用。我們不會向您收費。它不會顯示在這些指標中。但是，您可以在其他工具 (例如 `df`) 中看到此額外儲存空間。

### 1.3.0 版或更早版本
<a name="fargate-task-storage-pv13"></a>

對於使用平台 `1.3.0` 版或更早版本的 Fargate 任務上的 Amazon ECS，每個任務都會收到下列暫時性儲存。
+ 10 GB 的 Docker 層儲存體
**注意**  
此數量包括壓縮和未壓縮的容器映像成品。
+ 額外的 4 GB 磁碟區掛載。這可以在任務定義中使用 `volumes`、`mountPoints` 和 `volumesFrom` 參數的容器之間進行掛載和共用。

## Fargate Windows 容器平台版本
<a name="fargate-task-storage-windows-pv"></a>

### 1.0.0 版或更新版本
<a name="fargate-task-storage-pvws1"></a>

依預設，使用平台版本 `1.0.0` 或更新版本的託管於 Fargate 上的所有 Amazon ECS 任務都會收到至少 20 GiB 的暫時性儲存。暫時性儲存的總量可以增加，最多可達 200 GiB。您可在任務定義中指定 `ephemeralStorage` 參數來實現這一操作。

任務的提取、壓縮和未壓縮容器映像會存放在暫時性儲存體中。若要判斷您的任務必須使用的暫時性儲存總量，您必須從為任務配置的暫時性儲存總量中減去容器映像使用的儲存量。

如需詳細資訊，請參閱[搭配 Amazon ECS 使用綁定掛載](bind-mounts.md)。

# Amazon ECS AWS Fargate 暫時性儲存的客戶受管金鑰
<a name="fargate-storage-encryption"></a>

AWS Fargate 支援客戶受管金鑰來加密存放在暫時性儲存體中的 Amazon ECS 任務的資料，以協助對法規敏感的客戶滿足其內部安全政策。客戶在享有 Fargate 無伺服器優勢的同時，仍能向合規稽核人員展現對自行管理儲存加密的增強可見性。儘管 Fargate 預設提供由 Fargate 管理的暫時性儲存加密，但客戶在加密財務或健康相關資訊等敏感資料時，也可使用自行管理金鑰。

您可以將自己的金鑰匯入 ， AWS KMS 或在其中建立金鑰 AWS KMS。這些自我管理金鑰存放在 中 AWS KMS ，並執行標準 AWS KMS 生命週期動作，例如輪換、停用和刪除。您可以在 CloudTrail 日誌中稽核金鑰的存取與使用情況。

依預設，每個 KMS 金鑰可支援 50,000 個授權。Fargate 會針對每個客戶受管金鑰任務使用單一 AWS KMS 授權，因此支援金鑰最多 50，000 個並行任務。若想提高此數量，您可以申請提高限額，此類申請將依具體情況加以核准。

Fargate 不會對使用客戶自管金鑰而收取任何額外費用。您只需支付使用儲存和 API 請求 AWS KMS 金鑰的標準價格。

**Topics**
+ [為 Amazon ECS 建立 Fargate 暫時性儲存的加密金鑰](fargate-create-storage-key.md)
+ [管理 Amazon ECS Fargate 暫時性儲存的 AWS KMS 金鑰](fargate-managing-kms-key.md)

# 為 Amazon ECS 建立 Fargate 暫時性儲存的加密金鑰
<a name="fargate-create-storage-key"></a>

建立客戶自管金鑰，加密儲存於 Fargate 暫時性儲存中的資料。

**注意**  
使用客戶自管金鑰的 Fargate 暫時性儲存加密，不適用於 Windows 任務叢集。  
使用客戶自管金鑰的 Fargate 暫時性儲存加密，不適用於早於 `1.4.0` 的 `platformVersions`。  
Fargate 會在僅供 Fargate 使用的暫時性儲存上保留空間，而且不會向您收取該空間的費用。資源配置能與非客戶自管金鑰的任務不同，但總空間保持不變。您可以在 `df` 等工具中檢視此變更。  
Fargate 暫時性儲存不支援多區域金鑰。  
Fargate 暫時性儲存不支援 KMS 金鑰別名。

若要建立客戶受管金鑰 (CMK) 來加密 Fargate 中的暫時性儲存 AWS KMS，請遵循下列步驟。

1. 導覽至 [https://console.aws.amazon.com/kms](https://console.aws.amazon.com/kms)。

1. 請遵循 [AWS Key Management Service Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) 中的 [Creating Keys](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html) 的說明操作。

1. 建立 AWS KMS 金鑰時，請務必在金鑰政策中提供 Fargate 服務相關的 AWS KMS 操作許可。若要將客戶自管金鑰與 Amazon ECS 叢集資源搭配使用，必須在金鑰政策中允許下列 API 操作。
   + `kms:GenerateDataKeyWithoutPlainText` ‐ 呼叫 從提供的金鑰`GenerateDataKeyWithoutPlainText`產生加密的資料 AWS KMS 金鑰。
   + `kms:CreateGrant`：新增客戶自管金鑰的授權。授予控制對指定 AWS KMS 金鑰的存取，允許存取 Amazon ECS Fargate 所需的授予操作。如需詳細資訊，請參閱 [AWS Key Management Service Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) 中的 [Using Grants](https://docs.aws.amazon.com/kms/latest/developerguide/grants.html)。此授權使 Amazon ECS Fargate 能執行以下操作：
     + 呼叫 `Decrypt` AWS KMS 以取得加密金鑰，以解密暫時性儲存資料。
     + 設定淘汰主體，允許服務 `RetireGrant`。
   + `kms:DescribeKey` ‐ 提供客戶自管金鑰詳細資訊，使 Amazon ECS 能驗證金鑰是否對稱且已啟用。

   下列範例顯示您要套用至目標 AWS KMS 金鑰以進行加密的金鑰政策。若要使用下列政策範例，請將*使用者輸入預留位置*取代為您自己的資訊。一如往常，只設定您需要的許可，但您需要為至少一個使用者提供 AWS KMS 許可，以避免錯誤。

   ```
   {
         "Sid": "Allow generate data key access for Fargate tasks.",
         "Effect": "Allow",
         "Principal": { "Service":"fargate.amazonaws.com" },
         "Action": [
           "kms:GenerateDataKeyWithoutPlaintext"
         ],
         "Condition": {
           "StringEquals": {
             "kms:EncryptionContext:aws:ecs:clusterAccount": [
               "customerAccountId"
             ],
             "kms:EncryptionContext:aws:ecs:clusterName": [
                "clusterName"
             ]   
           }
         },
         "Resource": "*"
       },
       {
         "Sid": "Allow grant creation permission for Fargate tasks.",
         "Effect": "Allow",
         "Principal": { "Service":"fargate.amazonaws.com" },
         "Action": [
           "kms:CreateGrant"
         ],
         "Condition": {
           "StringEquals": {
             "kms:EncryptionContext:aws:ecs:clusterAccount": [
               "customerAccountId"
             ],
             "kms:EncryptionContext:aws:ecs:clusterName": [
                "clusterName"
             ]   
           },
          "ForAllValues:StringEquals": {
             "kms:GrantOperations": [
                "Decrypt"
             ]
          }
         },
         "Resource": "*"
       },
       {
         "Sid": "Allow describe key permission for cluster operator - CreateCluster and UpdateCluster.",
         "Effect": "Allow",
         "Principal": { "AWS":"arn:aws:iam::customerAccountId:role/customer-chosen-role" },
         "Action": [
           "kms:DescribeKey"
         ],
         "Resource": "*"
       }
   ```

   Fargate 任務使用 `aws:ecs:clusterAccount` 與 `aws:ecs:clusterName` 加密內容金鑰搭配該金鑰進行密碼編譯操作。客戶應新增這些許可，限制對特定帳戶和/或叢集的存取。在指定叢集時，請使用叢集名稱而非 ARN。

   如需詳細資訊，請參閱 [AWS KMS 開發人員指南](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)中的[加密內容](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)。

   建立或更新叢集時，您可以選擇使用條件索引鍵 `fargateEphemeralStorageKmsKeyId`。此條件索引鍵讓客戶可以更精細地控制 IAM 政策。`fargateEphemeralStorageKmsKeyId` 組態的更新僅在新服務部署上生效。

   以下是允許客戶僅將許可授予一組特定核准 AWS KMS 金鑰的範例。

------
#### [ JSON ]

****  

   ```
   {
     "Version":"2012-10-17",		 	 	 
     "Statement": [
       {
         "Effect": "Allow",
         "Action": [
           "ecs:CreateCluster",
           "ecs:UpdateCluster"
         ],
         "Resource": "*",
         "Condition": {
           "StringEquals": {
             "ecs:fargate-ephemeral-storage-kms-key": "arn:aws:kms:us-west-2:111122223333:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
           }
         }
       }
     ]
   }
   ```

------

   接下來是拒絕嘗試移除已與叢集建立關聯的 AWS KMS 金鑰的範例。

------
#### [ JSON ]

****  

   ```
   {
     "Version":"2012-10-17",		 	 	 
     "Statement": {
       "Effect": "Deny",
       "Action": [
           "ecs:CreateCluster",
           "ecs:UpdateCluster"
       ],
       "Resource": "*",
       "Condition": {
         "Null": {
           "ecs:fargate-ephemeral-storage-kms-key": "true"
         }
       }
     }
   }
   ```

------

   客戶可以使用 `describe-cluster`、 或 AWS CLI `describe-tasks``describe-services`命令，查看其未受管任務或服務任務是否使用 金鑰加密。

   如需詳細資訊，請參閱 [AWS KMS Developer Guide](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html) 中的 [Condition keys for AWS KMS](https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html)。

------
#### [ AWS 管理主控台 ]

1. 開啟主控台，網址為 [https://console.aws.amazon.com/ecs/v2](https://console.aws.amazon.com/ecs/v2)。

1. 請於左側導覽中選擇**叢集**，然後點選右上角的**建立叢集**，或選取現有叢集。若採用現有叢集，則選擇右上角的**更新叢集**。

1. 在工作流程的**加密**區段下，您可以選擇在**受管儲存**和 **Fargate 暫時性儲存**下選取 AWS KMS 金鑰。您也可以從這裡選擇**建立 AWS KMS 金鑰**。

1. 完成新叢集的建立後，請選擇**建立**；如果要更新現有叢集，請選擇**更新**。

------
#### [ AWS CLI ]

以下是使用 建立叢集和設定 Fargate 暫時性儲存的範例 AWS CLI （使用您自己的值取代*紅色*值）：

```
aws ecs create-cluster --cluster clusterName \
--configuration '{"managedStorageConfiguration":{"fargateEphemeralStorageKmsKeyId":"arn:aws:kms:us-west-2:012345678901:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"}}'
{
    "cluster": {
        "clusterArn": "arn:aws:ecs:us-west-2:012345678901:cluster/clusterName",
        "clusterName": "clusterName",
        "configuration": {
            "managedStorageConfiguration": {
                "fargateEphemeralStorageKmsKeyId": "arn:aws:kms:us-west-2:012345678901:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
            }
        },
        "status": "ACTIVE",
        "registeredContainerInstancesCount": 0,
        "runningTasksCount": 0,
        "pendingTasksCount": 0,
        "activeServicesCount": 0,
        "statistics": [],
        "tags": [],
        "settings": [],
        "capacityProviders": [],
        "defaultCapacityProviderStrategy": []
    },
    "clusterCount": 5
}
```

------
#### [ CloudFormation ]

以下是使用 建立叢集和設定 Fargate 暫時性儲存的範例範本 CloudFormation （使用您自己的值取代*紅色*值）：

```
AWSTemplateFormatVersion: 2010-09-09
Resources:
  MyCluster: 
    Type: AWS::ECS::Cluster
    Properties: 
      ClusterName: "clusterName" 
      Configuration:
        ManagedStorageConfiguration:
          FargateEphemeralStorageKmsKeyId: "arn:aws:kms:us-west-2:012345678901:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
```

------

# 管理 Amazon ECS Fargate 暫時性儲存的 AWS KMS 金鑰
<a name="fargate-managing-kms-key"></a>

在建立或匯入您的 AWS KMS 金鑰以加密 Fargate 暫時性儲存體之後，您可以像管理任何其他 AWS KMS 金鑰一樣進行管理。

**自動輪換 AWS KMS 金鑰**  
您可以啟用自動金鑰輪換功能，也可以手動輪換金鑰。自動金鑰輪換會每年為您輪換金鑰，方法是為金鑰產生新的密碼編譯材料。 AWS KMS 也會儲存所有舊版本的密碼編譯材料，因此您可以解密使用舊金鑰版本的任何資料。在您刪除金鑰 AWS KMS 之前， 不會刪除任何輪換的資料。

自動金鑰輪換是選用功能，可以隨時啟用或停用。

**停用或撤銷 AWS KMS 金鑰**  
如果您在 中停用客戶受管金鑰 AWS KMS，對執行中的任務沒有任何影響，而且它們會在其生命週期內繼續運作。如果新任務使用已停用或已撤銷的金鑰，任務會因無法存取金鑰而失敗。您應該設定 CloudWatch 警示或類似警示，確保不再需要已停用的金鑰來解密已加密的資料。

**刪除 AWS KMS 金鑰**  
刪除金鑰應一律是最後手段，且僅在確定不再需要刪除的金鑰時才應執行該動作。嘗試使用已刪除金鑰的新任務將會失敗，因為他們無法存取該金鑰。 AWS KMS 建議停用金鑰，而不是將其刪除。若確有必要刪除某個金鑰，建議先停用金鑰並設定 CloudWatch 警示，確保該金鑰不再被使用。如果您刪除金鑰， AWS KMS 至少提供七天來改變主意。

**稽核 AWS KMS 金鑰存取**  
您可以使用 CloudTrail 日誌來稽核對 AWS KMS 金鑰的存取。您可以檢查 AWS KMS 操作 `CreateGrant`、 `GenerateDataKeyWithoutPlaintext`和 `Decrypt`。這些操作也會在 CloudTrail 記錄中顯示作為 `EncryptionContext` 組成部分的 `aws:ecs:clusterAccount` 與 `aws:ecs:clusterName`。

以下是 `GenerateDataKeyWithoutPlaintext`、`GenerateDataKeyWithoutPlaintext (DryRun)`、`CreateGrant`、`CreateGrant (DryRun)` 與 `RetireGrant` 的 CloudTrail 事件範例 (將*紅色*值取代為實際參數)。

------
#### [ GenerateDataKeyWithoutPlaintext ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AWSService",
        "invokedBy": "ec2-frontend-api.amazonaws.com"
    },
    "eventTime": "2024-04-23T18:08:13Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "GenerateDataKeyWithoutPlaintext",
    "awsRegion": "us-west-2",
    "sourceIPAddress": "ec2-frontend-api.amazonaws.com",
    "userAgent": "ec2-frontend-api.amazonaws.com",
    "requestParameters": {
        "numberOfBytes": 64,
        "keyId": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "encryptionContext": {
            "aws:ecs:clusterAccount": "account-id",
            "aws:ebs:id": "vol-xxxxxxx",
            "aws:ecs:clusterName": "cluster-name"
        }
    },
    "responseElements": null,
    "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
    "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
    "readOnly": true,
    "resources": [
        {
            "accountId": "AWS Internal",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "account-id",
    "sharedEventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa",
    "eventCategory": "Management"
}
```

------
#### [ GenerateDataKeyWithoutPlaintext (DryRun) ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AWSService",
        "invokedBy": "fargate.amazonaws.com"
    },
    "eventTime": "2024-04-23T18:08:11Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "GenerateDataKeyWithoutPlaintext",
    "awsRegion": "us-west-2",
    "sourceIPAddress": "fargate.amazonaws.com",
    "userAgent": "fargate.amazonaws.com",
    "errorCode": "DryRunOperationException",
    "errorMessage": "The request would have succeeded, but the DryRun option is set.",
    "requestParameters": {
        "keyId": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "dryRun": true,
        "numberOfBytes": 64,
        "encryptionContext": {
            "aws:ecs:clusterAccount": "account-id",
            "aws:ecs:clusterName": "cluster-name"
        }
    },
    "responseElements": null,
    "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
    "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
    "readOnly": true,
    "resources": [
        {
            "accountId": "AWS Internal",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "account-id",
    "sharedEventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa",
    "eventCategory": "Management"
}
```

------
#### [ CreateGrant ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AWSService",
        "invokedBy": "ec2-frontend-api.amazonaws.com"
    },
    "eventTime": "2024-04-23T18:08:13Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "CreateGrant",
    "awsRegion": "us-west-2",
    "sourceIPAddress": "ec2-frontend-api.amazonaws.com",
    "userAgent": "ec2-frontend-api.amazonaws.com",
    "requestParameters": {
        "keyId": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "granteePrincipal": "fargate.us-west-2.amazonaws.com",
        "operations": [
            "Decrypt"
        ],
        "constraints": {
            "encryptionContextSubset": {
                "aws:ecs:clusterAccount": "account-id",
                "aws:ebs:id": "vol-xxxx",
                "aws:ecs:clusterName": "cluster-name"
            }
        },
        "retiringPrincipal": "ec2.us-west-2.amazonaws.com"
    },
    "responseElements": {
        "grantId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "keyId": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
    },
    "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
    "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
    "readOnly": false,
    "resources": [
        {
            "accountId": "AWS Internal",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "account-id",
    "sharedEventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa",
    "eventCategory": "Management"
}
```

------
#### [ CreateGrant (DryRun) ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AWSService",
        "invokedBy": "fargate.amazonaws.com"
    },
    "eventTime": "2024-04-23T18:08:11Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "CreateGrant",
    "awsRegion": "us-west-2",
    "sourceIPAddress": "fargate.amazonaws.com",
    "userAgent": "fargate.amazonaws.com",
    "errorCode": "DryRunOperationException",
    "errorMessage": "The request would have succeeded, but the DryRun option is set.",
    "requestParameters": {
        "keyId": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
        "granteePrincipal": "fargate.us-west-2.amazonaws.com",
        "dryRun": true,
        "operations": [
            "Decrypt"
        ],
        "constraints": {
            "encryptionContextSubset": {
                "aws:ecs:clusterAccount": "account-id",
                "aws:ecs:clusterName": "cluster-name"
            }
        }
    },
    "responseElements": null,
    "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
    "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
    "readOnly": false,
    "resources": [
        {
            "accountId": "AWS Internal",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "account-id",
    "sharedEventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa",
    "eventCategory": "Management"
}
```

------
#### [ RetireGrant ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AWSService",
        "invokedBy": "AWS Internal"
    },
    "eventTime": "2024-04-20T18:37:38Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "RetireGrant",
    "awsRegion": "us-west-2",
    "sourceIPAddress": "AWS Internal",
    "userAgent": "AWS Internal",
    "requestParameters": null,
    "responseElements": {
        "keyId": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
    },
    "additionalEventData": {
        "grantId": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
    },
    "requestID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
    "eventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
    "readOnly": false,
    "resources": [
        {
            "accountId": "AWS Internal",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:us-west-2:account-id:key/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "account-id",
    "sharedEventID": "a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa",
    "eventCategory": "Management"
}
```

------