本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
配置 Amazon EMR 集群的可发现性(面向管理员)
本节详细介绍管理员如何配置 Studio Classic 中现有 Amazon EMR 集群 SageMaker 的可发现性。集群可以部署在与 Studio Classic 相同的 Amazon 账户(“单一账户” 选项卡)中,也可以部署在不同的账户(“跨账户” 选项卡)中。
- Single Account
-
将以下权限附加到 SageMaker Studio Classic 执行角色访问您的集群。
以下列表提供了所需权限的明细。
-
AllowSagemakerProjectManagement
允许创建SageMaker项目。在 Studio Classic 中,访问权限 Amazon Service Catalog 是通过项目授予的。 -
AllowClusterDetailsDiscovery
和AllowClusterDiscovery
允许发现并连接到 Amazon EMR 集群。 -
AllowPresignedUrl
允许创建用于访问 Spark UI 的预签名网址。
以下是包含这些权限的综合 JSON。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPresignedUrl", "Effect": "Allow", "Action": [ "elasticmapreduce:DescribeCluster", "elasticmapreduce:ListInstanceGroups", "elasticmapreduce:CreatePersistentAppUI", "elasticmapreduce:DescribePersistentAppUI", "elasticmapreduce:GetPersistentAppUIPresignedURL", "elasticmapreduce:GetOnClusterAppUIPresignedURL" ], "Resource": [ "arn:aws:elasticmapreduce:
region
:account-id
:cluster/*" ] }, { "Sid": "AllowClusterDetailsDiscovery", "Effect": "Allow", "Action": [ "elasticmapreduce:DescribeCluster", "elasticmapreduce:ListInstances", "elasticmapreduce:ListInstanceGroups", "elasticmapreduce:DescribeSecurityConfiguration" ], "Resource": [ "arn:aws:elasticmapreduce:region
:account-id
:cluster/*" ] }, { "Sid": "AllowClusterDiscovery", "Effect": "Allow", "Action": [ "elasticmapreduce:ListClusters" ], "Resource": "*" }, { "Sid": "AllowSagemakerProjectManagement", "Effect": "Allow", "Action": [ "sagemaker:CreateProject", "sagemaker:DeleteProject" ], "Resource": "arn:aws:sagemaker:region
:account-id
:project/*" } ] } -
- Cross Accounts
-
如果您的 Amazon EMR 集群和 SageMaker Studio Classic 部署在不同的 Amazon 账户中,则需要分多个步骤配置权限。
-
在信任账户(部署 Amazon EMR 的账户)上,创建具有以下权限和信任关系的自定义 IAM 角色(在本页中称为
ASSUMABLE-ROLE
)。有关在 Amazon 账户上创建角色的信息,请参阅创建 IAM 角色(控制台)。
-
添加策略,定义以下权限。
-
AllowClusterDetailsDiscovery
和AllowClusterDiscovery
,以允许发现并连接到 Amazon EMR 集群。 -
AllowPresignedUrl
,以允许创建用于访问 Spark UI 的预签名 URL。
以下是包含这些权限的综合 JSON。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPresignedUrl", "Effect": "Allow", "Action": [ "elasticmapreduce:DescribeCluster", "elasticmapreduce:ListInstanceGroups", "elasticmapreduce:CreatePersistentAppUI", "elasticmapreduce:DescribePersistentAppUI", "elasticmapreduce:GetPersistentAppUIPresignedURL", "elasticmapreduce:GetOnClusterAppUIPresignedURL" ], "Resource": [ "arn:aws:elasticmapreduce:
emr-region
:emr-account
:cluster/*" ] }, { "Sid": "AllowClusterDetailsDiscovery", "Effect": "Allow", "Action": [ "elasticmapreduce:DescribeCluster", "elasticmapreduce:ListInstances", "elasticmapreduce:ListInstanceGroups", "elasticmapreduce:DescribeSecurityConfiguration" ], "Resource": [ "arn:aws:elasticmapreduce:emr-region
:emr-account
:cluster/*" ] }, { "Sid": "AllowClusterDiscovery", "Effect": "Allow", "Action": [ "elasticmapreduce:ListClusters" ], "Resource": "*" } ] } -
-
要向可信账户(部署 SageMaker Studio Classic 账户的账户)授予在信任账户中扮演角色的权限,请添加以下信任关系。
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::
studio-account
:root" }, "Action": "sts:AssumeRole" } ] }
-
-
在可信账户(部署 SageMaker Studio Classic 的账户)上,将以下信任关系添加到 Studio Classic 执行角色。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowRoleAssumptionForCrossAccountDiscovery", "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": ["arn:aws:iam::
emr-account
:role/ASSUMABLE-ROLE
" ] }] } -
最后,请参阅,了解针对跨账户使用场景的其他配置(面向管理员)如何向 Studio Classic 执行角色提供 ARN。
ASSUMABLE-ROLE
ARN 在启动时由 Studio Classic Jupyter 服务器加载。Studio Classic 执行角色扮演该跨账户角色,在信任账户中发现并连接到 Amazon EMR 集群。
-
访问了解探索 Studio Classic 中的 SageMaker亚马逊 EMR 集群如何通过 Studio Classic 笔记本电脑发现和连接 Amazon EMR 集群。