为启用了 IAM Identity Center 的 EMR 集群配置 Lake Formation - Amazon EMR
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

为启用了 IAM Identity Center 的 EMR 集群配置 Lake Formation

您可以Amazon Lake Formation与 Amazon IAM Identity Center 启用的 EMR 集群集成。

首先,请确保在与集群相同的区域中设置 Identity Center 实例。有关更多信息,请参阅 创建 Identity Center 实例。当您查看实例详细信息时,可以在 IAM Identity Center 控制台中找到实例 ARN,或者使用以下命令从 CLI 中查看所有实例的详细信息:

aws sso-admin list-instances

然后使用带有以下命令的 ARN 和您的 Amazon 账户 ID 将 Lake Formation 配置为与 IAM 身份中心兼容:

aws lakeformation create-lake-formation-identity-center-configuration --cli-input-json file://create-lake-fromation-idc-config.json json input: { "CatalogId": "account-id/org-account-id", "InstanceArn": "identity-center-instance-arn" }

现在,调用 put-data-lake-settings 并使用 Lake Formation 启用 AllowFullTableExternalDataAccess

aws lakeformation put-data-lake-settings --cli-input-json file://put-data-lake-settings.json json input: { "DataLakeSettings": { "DataLakeAdmins": [ { "DataLakePrincipalIdentifier": "admin-ARN" } ], "CreateDatabaseDefaultPermissions": [...], "CreateTableDefaultPermissions": [...], "AllowExternalDataFiltering": true, "AllowFullTableExternalDataAccess": true } }

最后,为访问 EMR 集群的用户授予身份 ARN 的完整表格权限。ARN 包含来自 Identity Center 的用户 ID。在控制台中导航到 Identity Center,选择用户,然后选择要查看其常规信息设置的用户。

将用户 ID 复制粘贴到 user-id 的以下 ARN 中:

arn:aws:identitystore:::user/user-id
注意

只有当 IAM Identity Center 身份对 Lake Formation 保护的表拥有完整的表访问权限时,EMR 集群上的查询才有效。如果该身份没有完整的表格访问权限,则查询将失败。

使用以下命令授予用户完整的表格访问权限:

aws lakeformation grant-permissions --cli-input-json file://grantpermissions.json json input: { "Principal": { "DataLakePrincipalIdentifier": "arn:aws:identitystore:::user/user-id" }, "Resource": { "Table": { "DatabaseName": "tip_db", "Name": "tip_table" } }, "Permissions": [ "ALL" ], "PermissionsWithGrantOption": [ "ALL" ] }