

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

# 設定 Studio 的受信任身分傳播
<a name="trustedidentitypropagation-setup"></a>

為 Amazon SageMaker Studio 設定受信任身分傳播需要您的 Amazon SageMaker AI 網域設定 IAM Identity Center 身分驗證方法。本節將引導您完成為 Studio 使用者啟用和設定受信任身分傳播所需的先決條件和步驟。

**Topics**
+ [先決條件](#trustedidentitypropagation-setup-prerequisites)
+ [為您的 Amazon SageMaker AI 網域啟用受信任的身分傳播](#trustedidentitypropagation-setup-enable)
+ [設定 SageMaker AI 執行角色](#trustedidentitypropagation-setup-permissions)

## 先決條件
<a name="trustedidentitypropagation-setup-prerequisites"></a>

在設定 SageMaker AI 的受信任身分傳播之前，請使用下列指示設定 IAM Identity Center。

**注意**  
確保您的 IAM Identity Center 與網域位於相同的區域。
+  [IAM Identity Center 受信任身分傳播先決條件](https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-overall-prerequisites.html#trustedidentitypropagation-prerequisites) 
+  [設定 IAM Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/getting-started.html) 
+  [將使用者新增至您的 IAM Identity Center 目錄](https://docs.aws.amazon.com/singlesignon/latest/userguide/addusers.html) 

## 為您的 Amazon SageMaker AI 網域啟用受信任的身分傳播
<a name="trustedidentitypropagation-setup-enable"></a>

**重要**  
您只能針對已設定 AWS IAM Identity Center 驗證方法的網域啟用受信任身分傳播。
您的 IAM Identity Center 和 Amazon SageMaker AI 網域必須位於相同的 AWS 區域中。

使用下列其中一個選項，了解如何為新的或現有的網域啟用受信任身分傳播。

------
#### [ New domain - console ]

**使用 SageMaker AI 主控台啟用新網域的受信任身分傳播**

1. 開啟 [Amazon SageMaker AI 主控台](https://console.aws.amazon.com/sagemaker)。

1. 導覽至**網域**。

1. [建立自訂網域](https://docs.aws.amazon.com/sagemaker/latest/dg/onboard-custom.html)。網域必須設定 **AWS IAM Identity Center** 驗證方法。

1. 在**受信任身分傳播**區段中，選擇**針對此網域上的所有使用者啟用受信任身分傳播**。

1. 完成自訂建立程序。

------
#### [ Existing domain - console ]

**使用 SageMaker AI 主控台啟用現有網域的受信任身分傳播**
**注意**  
若要讓受信任的身分傳播在為現有網域啟用之後正常運作，使用者將需要重新啟動其現有的 IAM Identity Center 工作階段。若要這樣做，請執行下列其中一項操作：  
使用者將需要登出並重新登入其現有的 IAM Identity Center 工作階段
管理員可以[結束其人力資源使用者的作用中工作階段](https://docs.aws.amazon.com/singlesignon/latest/userguide/end-active-sessions.html)。

1. 開啟 [Amazon SageMaker AI 主控台](https://console.aws.amazon.com/sagemaker)。

1. 導覽至**網域**。

1. 選取您現有的網域。網域必須設定 **AWS IAM Identity Center** 驗證方法。

1. 在**網域設定**索引標籤中，選擇**驗證和許可**區段中的**編輯**。

1. 選擇**針對此網域上的所有使用者受信任身分傳播**。

1. 完成網域組態。

------
#### [ Existing domain - AWS CLI ]

使用 啟用現有網域的受信任身分傳播 AWS CLI

**注意**  
若要讓受信任的身分傳播在為現有網域啟用之後正常運作，使用者將需要重新啟動其現有的 IAM Identity Center 工作階段。若要這樣做，請執行下列其中一項操作：  
使用者將需要登出並重新登入其現有的 IAM Identity Center 工作階段
管理員可以[結束其人力資源使用者的作用中工作階段](https://docs.aws.amazon.com/singlesignon/latest/userguide/end-active-sessions.html)。

```
aws sagemaker update-domain \
    --region $REGION \
    --domain-id $DOMAIN_ID \
    --domain-settings "TrustedIdentityPropagationSettings={Status=ENABLED}"
```
+ `DOMAIN_ID` 是 Amazon SageMaker AI 網域 ID。如需詳細資訊，請參閱[檢視網域](https://docs.aws.amazon.com/sagemaker/latest/dg/domain-view.html)。
+ `REGION` 是 Amazon SageMaker AI 網域 AWS 區域 的 。您可以在任何 AWS 主控台頁面的右上角找到此項目。

------

## 設定 SageMaker AI 執行角色
<a name="trustedidentitypropagation-setup-permissions"></a>

若要針對 Studio 使用者啟用受信任身分傳播，所有受信任身分傳播角色都需要設定下列內容許可。更新所有角色的信任政策，以包含 `sts:AssumeRole` 和 `sts:SetContext` 動作。當您[更新角色信任政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-trust-policy.html)時，請使用下列政策。

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

****  

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

------