

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

# 使用訓練和處理任務將 Studio JupyterLab 筆記本連線至 Amazon S3 存取授權
<a name="trustedidentitypropagation-s3-access-grants-jobs"></a>

使用下列資訊授與 Amazon S3 存取授權，以存取 Amazon SageMaker 訓練和處理任務中的資料。

當已啟用受信任身分傳播的使用者啟動需要存取 Amazon S3 資料的 SageMaker 訓練或處理任務時：
+ SageMaker AI 會根據使用者的身分呼叫 Amazon S3 存取授權以取得臨時憑證
+ 如果成功，這些臨時憑證會存取 Amazon S3 資料
+ 如果失敗，SageMaker AI 會回復為使用 IAM 角色憑證

**注意**  
若要強制透過 Amazon S3 存取授權授與所有許可，您需要移除執行角色的相關 Amazon S3 存取許可，並將其連接至對應的 [Amazon S3 存取授權](https://docs.aws.amazon.com/singlesignon/latest/userguide/tip-tutorial-s3.html#tip-tutorial-s3-create-grant)。

**Topics**
+ [考量事項](#s3-access-grants-jobs-considerations)
+ [使用訓練和處理任務設定 Amazon S3 存取授權](#s3-access-grants-jobs-setup)

## 考量事項
<a name="s3-access-grants-jobs-considerations"></a>

Amazon S3 存取授權無法與 SageMaker 訓練和處理的[管道模式](https://docs.aws.amazon.com/sagemaker/latest/dg/augmented-manifest-stream.html)搭配使用，以取得 Amazon S3 輸入。

受信任身分傳播啟用時，您無法啟動具有下列功能的 SageMaker 訓練任務
+ 遠端偵錯
+ Debugger
+ Profiler

受信任身分傳播啟用時，您無法啟動具有下列功能的處理任務
+ DatasetDefinition

## 使用訓練和處理任務設定 Amazon S3 存取授權
<a name="s3-access-grants-jobs-setup"></a>

在設定 Amazon S3 存取授權之後，請[將下列許可新增至](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html)您的網域或使用者[執行角色](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html#sagemaker-roles-get-execution-role)。
+ `us-east-1` 是您的 AWS 區域
+ `111122223333` 是您的 AWS 帳戶 ID
+ `S3-ACCESS-GRANT-ROLE` 是您的 Amazon S3 存取授權角色

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "AllowDataAccessAPI",
            "Effect": "Allow",
            "Action": [
                "s3:GetDataAccess",
                "s3:GetAccessGrantsInstanceForPrefix"
            ],
            "Resource": [
                "arn:aws:s3:us-east-1:111122223333:access-grants/default"
            ]
        },
        {
            "Sid": "RequiredForIdentificationPropagation",
            "Effect": "Allow",
            "Action": "sts:SetContext",
            "Resource": "arn:aws:iam::111122223333:role/S3-ACCESS-GRANT-ROLE"
        }
    ]
}
```

------