简体   繁体   English

aws sagemaker - IAM 调用 get_role 的权限

[英]aws sagemaker - IAM permission to call get_role

Question问题

In which AWS documentation explains the IAM permissions required to run SageMaker in a SageMaker Studio?在哪个 AWS 文档中解释了在 SageMaker Studio 中运行 SageMaker 所需的 IAM 权限?

Problem问题

In a SageMaker Studio with an IAM policy AmazonSageMakerFullAccess attached.在附加了 IAM 策略AmazonSageMakerFullAccess的 SageMaker Studio 中。

The AWS documentation AmazonSageMakerFullAccess : AWS 文档AmazonSageMakerFullAccess

This policy grants administrative permissions that allow a principal full access to all Amazon SageMaker resources and operations.此策略授予管理权限,允许委托人完全访问所有 Amazon SageMaker 资源和操作。 The policy also provides select access to related services .该政策还提供select访问相关服务

Permissions details权限详情

This policy includes the following permissions.此策略包括以下权限。
... ...
iam – Needed to give the SageMaker console access to available IAM roles and create service-linked roles. iam – 需要让 SageMaker 控制台访问可用的 IAM 角色并创建服务相关角色。

However, run the code below as instructed SageMaker Roles fails.但是,按照指示运行以下代码SageMaker 角色失败。

import sagemaker

sess = sagemaker.Session()
role = sagemaker.get_execution_role()
-----
Couldn't call 'get_role' to get Role ARN from role name <IAM Role Name> to get Role path.

在此处输入图像描述

Fix使固定

Attached iam:GetRole permission to solve the issue.附上iam:GetRole权限解决问题。 However, where is it documented?但是,它在哪里记录?

在此处输入图像描述

Related有关的

Apparently AWS acknowledged this is an issue in 2020 and has not updated document?显然 AWS 承认这是 2020 年的问题并且没有更新文档?

Well yeah I found a solution, but you should probably fix the underlying problem- either in the documentation or in your policies themselves.嗯,是的,我找到了一个解决方案,但您可能应该解决潜在的问题 - 无论是在文档中还是在您的政策本身中。

I hope your issue is resolved - and I tested it just now with only AmazonSageMakerFullAccess attached to my execution role, and I am able to execute the cell without any permission errors.我希望您的问题得到解决 - 我刚才测试了它,我的执行角色只附加了 AmazonSageMakerFullAccess,我能够在没有任何权限错误的情况下执行单元。

Edit: The GitHub documentation is already updated to specify the permission required if your role has a path in it.编辑: GitHub 文档已经更新,以指定您的角色在其中有路径时所需的权限。 If there is no path in your role, AmazonSageMakerFullAccess should suffice (as in my case).如果您的角色中没有路径,AmazonSageMakerFullAccess 就足够了(就像我的情况一样)。

I work at AWS and my opinions are my own.我在 AWS 工作,我的观点是我自己的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM