

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

# AWS Lake Formation 使用 IAM Identity Center 設定
<a name="tip-tutorial-lf"></a>

[AWS Lake Formation](https://docs.aws.amazon.com//lake-formation/latest/dg/what-is-lake-formation.html) 是一種受管服務，可簡化資料湖的建立和管理 AWS。它可自動化資料收集、分類和安全性，提供集中式儲存庫來存放和分析各種資料類型。Lake Formation 提供精細的存取控制，並與各種 AWS 分析服務整合，讓組織能夠有效率地設定、保護並從其資料湖衍生洞見。

請依照下列步驟，使用 IAM Identity Center 和信任的身分傳播，讓 Lake Formation 根據使用者身分授予資料許可。

## 先決條件
<a name="tip-tutorial-lf-prereqs"></a>

您必須先設定下列項目，才能開始使用本教學課程：
+ [啟用 IAM Identity Center](enable-identity-center.md)。建議使用[組織執行個體](organization-instances-identity-center.md)。如需詳細資訊，請參閱[先決條件和考量事項](trustedidentitypropagation-overall-prerequisites.md)。

## 設定受信任身分傳播的步驟
<a name="tip-tutorial-lf-step1"></a>

1. 將 **IAM Identity Center 與 整合 AWS Lake Formation**，並遵循[將 Lake Formation 與 IAM Identity Center ](https://docs.aws.amazon.com//lake-formation/latest/dg/connect-lf-identity-center.html)連接中的指引。
**重要**  
**如果您沒有 AWS Glue Data Catalog 資料表，您必須建立這些資料表**，才能使用 AWS Lake Formation 將存取權授予 IAM Identity Center 使用者和群組。如需詳細資訊，請參閱在 [中建立物件 AWS Glue Data Catalog](https://docs.aws.amazon.com//lake-formation/latest/dg/populating-catalog.html)。

1. **註冊資料湖位置**。

   [註冊存放 Glue 資料表資料的 S3 位置](https://docs.aws.amazon.com//lake-formation/latest/dg/register-location.html)。藉由這樣做，Lake Formation 會在查詢資料表時佈建對所需 S3 位置的臨時存取權，因此不需要在服務角色 （例如 WorkGroup 上設定的 Athena 服務角色） 中包含 S3 許可。

   1. 在 AWS Lake Formation 主控台的導覽窗格中，導覽至**管理**區段下方的**資料湖位置**。選取**註冊位置**。

      這將允許 Lake Formation 佈建具有存取 S3 資料位置必要許可的臨時 IAM 登入資料。  
![\[步驟 1 在 Lake Formation 主控台中註冊資料湖位置。\]](http://docs.aws.amazon.com/zh_tw/singlesignon/latest/userguide/images/lf-tutorial-step-3.1.png)

   1. 在 Amazon S3 路徑欄位中輸入資料表資料位置的 AWS Glue S3 路徑。 **Amazon S3 ** 

   1. 在 **IAM 角色**區段中，如果您想要將服務連結角色與信任的身分傳播搭配使用，請勿選取該角色。建立具有下列許可的個別角色。

      若要使用這些政策，請以您自己的資訊取代範例政策中的*斜體預留位置文字*。如需其他指示，請參閱[建立政策](https://docs.aws.amazon.com//IAM/latest/UserGuide/access_policies_create.html)或[編輯政策](https://docs.aws.amazon.com//IAM/latest/UserGuide/access_policies_manage-edit.html)。許可政策應授予路徑中指定之 S3 位置的存取權：

      1. **許可政策**：

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

****  

         ```
         {
             "Version":"2012-10-17",		 	 	 
             "Statement": [
                 {
                     "Sid": "LakeFormationDataAccessPermissionsForS3",
                     "Effect": "Allow",
                     "Action": [
                         "s3:PutObject",
                         "s3:GetObject",
                         "s3:DeleteObject"
                     ],
                     "Resource": [
                         "arn:aws:s3:::Your-S3-Bucket/*"
                     ]
                 },
                 {
                     "Sid": "LakeFormationDataAccessPermissionsForS3ListBucket",
                     "Effect": "Allow",
                     "Action": [
                         "s3:ListBucket"
                     ],
                     "Resource": [
                         "arn:aws:s3:::Your-S3-Bucket"
                     ]
                 },
                 {
                     "Sid": "LakeFormationDataAccessServiceRolePolicy",
                     "Effect": "Allow",
                     "Action": [
                         "s3:ListAllMyBuckets"
                     ],
                     "Resource": [
                         "arn:aws:s3:::*"
                     ]
                 }
             ]
         }
         ```

------

      1. **信任關係**：這應該包含 `sts:SectContext`，這是信任身分傳播的必要項目。

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

****  

         ```
         {
             "Version":"2012-10-17",		 	 	 
             "Statement": [
                 {
                     "Sid": "",
                     "Effect": "Allow",
                     "Principal": {
                         "Service": "lakeformation.amazonaws.com"
                     },
                     "Action": [
                         "sts:AssumeRole",
                         "sts:SetContext"
                     ]
                 }
             ]
         }
         ```

------
**注意**  
精靈建立的 IAM 角色是服務連結角色，不包含 `sts:SetContext`。

   1. 建立 IAM 角色後，選取**註冊位置**。

## 使用 Lake Formation 跨 進行信任的身分傳播 AWS 帳戶
<a name="tip-lf-across-accts"></a>

AWS Lake Formation 支援使用 [AWS Resource Access Manager (RAM)](https://docs.aws.amazon.com//ram/latest/userguide/what-is.html) 跨 共用資料表， AWS 帳戶 並在授予者帳戶和承授者帳戶位於相同 AWS 區域、相同 中，並共用相同的 IAM Identity Center 組織執行個體時 AWS Organizations，使用受信任的身分傳播。如需詳細資訊，請參閱 [Lake Formation 中的跨帳戶資料共用](https://docs.aws.amazon.com//lake-formation/latest/dg/cross-data-sharing-lf.html)。