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

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

在启用了 IAM Identity Center 的 EMR 集群上使用 S3 Access Grants

您可以将 S3 访问权限授予与 Amazon IAM Identity Center 启用的 EMR 集群集成。

使用 S3 Access Grants 从使用 Identity Center 的集群访问您的数据集。创建授权以增强您为 IAM 用户、组、角色或公司目录设置的权限。有关更多信息,请参阅将 S3 Access Grants 用于 Amazon EMR

创建 S3 Access Grants 实例和位置

如果您还没有实例,请在您要启动 EMR 集群的 Amazon Web Services 区域 中创建一个 S3 Access Grants 实例。

使用以下 Amazon CLI 命令创建一个名为的新实例MyInstance

aws s3control-access-grants create-access-grants-instance \ --account-id 12345678912 \ --identity-center-arn "identity-center-instance-arn" \

然后,创建一个 S3 Access Grants 位置,以将红色的值替换为您自己的值:

aws s3control-access-grants create-access-grants-location \ --account-id 12345678912 \ --location-scope s3:// \ --iam-role-arn "access-grant-role-arn" \ --region aa-example-1
注意

iam-role-arn 参数定义为 accessGrantRole ARN。

为 Identity Center 身份创建授权

最后,为有权访问您的集群的身份创建授权:

aws s3control-access-grants create-access-grant \ --account-id 12345678912 \ --access-grants-location-id "default" \ --access-grants-location-configuration S3SubPrefix="s3-bucket-prefix" --permission READ \ --grantee GranteeType=DIRECTORY_USER,GranteeIdentifier="your-identity-center-user-id"

输出示例:

{
"CreatedAt": "2023-09-21T23:47:24.870000+00:00",
"AccessGrantId": "1234-12345-1234-1234567",
"AccessGrantArn": "arn:aws:s3:aa-example-1-1:123456789012:access-grants/default/grant/xxxx1234-1234-5678-1234-1234567890",
"Grantee": {
"GranteeType": "DIRECTORY_USER",
"GranteeIdentifier": "5678-56789-5678-567890"
},
"AccessGrantsLocationId": "default",
"AccessGrantsLocationConfiguration": {
"S3SubPrefix": "myprefix/*"
},
"Permission": "READ",
"GrantScope": "s3://myprefix/*"
}