![](/img/trans.png)
[英]Unable to open Jupyter Notebook instance on AWS Sagemaker
[英]Is sagemaker:CreatePresignedDomainUrl required to open jupyter in SageMaker notebook instance?
我試圖避免使用托管策略AmazonSageMakerReadOnly
和AmazonSageMakerFullAccess
,因為我只希望用戶能夠啟動/停止他們自己的筆記本實例並在他們的實例中打開 jupyter。
到目前為止,用戶角色具有以下權限
...
{
"Sid": "",
"Effect": "Allow",
"Action": [
"sagemaker:StopNotebookInstance",
"sagemaker:StartNotebookInstance",
"sagemaker:CreatePresignedNotebookInstanceUrl"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/OwnerRole": "${aws:userid}"
}
}
},
該策略沒有sagemaker:CreatePresignedDomainUrl
但它有sagemaker:CreatePresignedNotebookInstanceUrl
,當具有此策略的用戶在 AWS Sagemaker 控制台中單擊Open Jupyter
時,它會打開一個 url https://xxxxxx.notebook.eu-north-1.sagemaker.aws/auth?authToken=xxxxx
但 url 將返回:
403 Forbidden. Access to xxxxxx.notebook.eu-north-1.sagemaker.aws was denied. You don't have authorisation to view this page. HTTP ERROR 403
一旦我為 resource *
添加了sagemaker:CreatePresignedDomainUrl
,403 錯誤就消失了,用戶可以打開 jupyter notebook。
我的問題是為什么需要,我應該放什么資源而不是*
,文檔提到arn:aws:sagemaker:regionXXX:account-idXXX:app/domain-id/userProfileNameXXXX/*
但我沒有任何域或用戶資料。
CreatePresignedDomainUrl
語句允許角色啟動 SageMaker Studio 應用程序(以及domain-id/user-profile
ARN)。 打開 SageMaker Notebook 實例不需要預簽名域 url 權限。
您需要確保使用 OwnerRole 鍵標記筆記本,值 = userid(不是用戶名)。 此外,您需要使用sagemaker:ResourceTag
(而不是aws:ResourceTag
)。
有關操作和條件鍵的完整列表,請參閱服務授權頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.