

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

# 將 ECR 映像提取至 AWS 您的帳戶
<a name="pull-ecr-customer-account"></a>

Athena Federation Connector Lambda 函式會使用存放在 Athena 受管 Amazon ECR 儲存庫中的容器映像。若要在這些容器映像上執行安全掃描，您必須先將其複製到帳戶中的 Amazon ECR 儲存庫。本節提供如何將映像複製到您的儲存庫，並設定 Lambda 函式以使用映像的逐步說明。

## 先決條件
<a name="pull-ecr-customer-account-prereq"></a>
+ Athena Federation Connector – 該連接器可以透過任何來源建立，前提是其使用了容器映像。
**注意**  
若要驗證映像部署，請檢查 Athena Federation Connector Lambda 中的映像索引標籤
+ Docker 已安裝且在執行中
+ AWS CLI 已安裝
+ 具有適當提取許可的帳戶憑證

## 如何傳輸映像
<a name="image-transfer-procedure"></a>

1. 從 Athena Federation Connector Lambda 找到映像 URI  
**Example**  

   ```
   account_id_1.dkr.ecr.us-east-1.amazonaws.com/athena-federation-repository:2025.15.1
   ```

1. 為 Athena 受管帳戶產生 Docker 身分驗證權杖：

   ```
   aws ecr get-login-password --region {{regionID}} | docker login --username AWS --password-stdin {{athena-managed-registry}}
   ```

   其中：
   + {{regionID}} 是您的部署區域 (例如 us-east-1)
   + {{athena-managed-registry}} 是映像 URI 的登錄檔部分 (例如 account\_id\_1.dkr.ecr.us-east-1.amazonaws.com)

1. 從 Athena 受管帳戶提取映像：

   ```
   docker pull {{athenaImageURI}}
   ```

1. 向您的登錄檔驗證 Docker：

   ```
   aws ecr get-login-password --region {{regionID}} | docker login --username AWS --password-stdin {{customer-registry}}
   ```

   其中 {{customer-registry}} 是您的 ECR 登錄檔 (例如 account\_id\_2.dkr.ecr.us-east-1.amazonaws.com)

1. 為您的儲存庫標記提取的映像：

   ```
   docker tag {{athenaImageURI}} {{yourImageURI}}
   ```

1. 將映像推送到您的儲存庫：

   ```
   docker push {{yourImageURI}}
   ```

1. 更新您的 Athena Federation Connector：

   1. 導覽至您的 Lambda 函式

   1. 選取**部署新映像**

   1. 輸入您的新映像 URI

   Athena 聯合連接器映像現在位於您的帳戶中，可讓您在映像上執行 CVE 掃描。