我正在尝试在Amazon EMR集群上创建笔记本。
我没有找到要添加为IAM的笔记本EMR_Notebooks_DefaultRole
的默认角色。存在的所有可用角色是:
添加策略并添加角色后,我得到了错误:
错误:服务角色无权访问S3 LocationUri {}
我的EMR_Notebooks_DefaultRole
的内容:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Resource": "*",
"Action": [
"ec2:AuthorizeSecurityGroupEgress",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:CancelSpotInstanceRequests",
"ec2:CreateNetworkInterface",
"ec2:CreateSecurityGroup",
"ec2:CreateTags",
"ec2:DeleteNetworkInterface",
"ec2:DeleteSecurityGroup",
"ec2:DeleteTags",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeAccountAttributes",
"ec2:DescribeDhcpOptions",
"ec2:DescribeImages",
"ec2:DescribeInstanceStatus",
"ec2:DescribeInstances",
"ec2:DescribeKeyPairs",
"ec2:DescribeNetworkAcls",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribePrefixLists",
"ec2:DescribeRouteTables",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSpotInstanceRequests",
"ec2:DescribeSpotPriceHistory",
"ec2:DescribeSubnets",
"ec2:DescribeTags",
"ec2:DescribeVpcAttribute",
"ec2:DescribeVpcEndpoints",
"ec2:DescribeVpcEndpointServices",
"ec2:DescribeVpcs",
"ec2:DetachNetworkInterface",
"ec2:ModifyImageAttribute",
"ec2:ModifyInstanceAttribute",
"ec2:RequestSpotInstances",
"ec2:RevokeSecurityGroupEgress",
"ec2:RunInstances",
"ec2:TerminateInstances",
"ec2:DeleteVolume",
"ec2:DescribeVolumeStatus",
"ec2:DescribeVolumes",
"ec2:DetachVolume",
"iam:GetRole",
"iam:GetRolePolicy",
"iam:ListInstanceProfiles",
"iam:ListRolePolicies",
"iam:PassRole",
"s3:*",
"s3:CreateBucket",
"s3:Get*",
"s3:List*",
"sdb:BatchPutAttributes",
"sdb:Select",
"sqs:CreateQueue",
"sqs:Delete*",
"sqs:GetQueue*",
"sqs:PurgeQueue",
"sqs:ReceiveMessage",
"cloudwatch:PutMetricAlarm",
"cloudwatch:DescribeAlarms",
"cloudwatch:DeleteAlarms",
"application-autoscaling:RegisterScalableTarget",
"application-autoscaling:DeregisterScalableTarget",
"application-autoscaling:PutScalingPolicy",
"application-autoscaling:DeleteScalingPolicy",
"application-autoscaling:Describe*"
]
},
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/spot.amazonaws.com/AWSServiceRoleForEC2Spot*",
"Condition": {
"StringLike": {
"iam:AWSServiceName": "spot.amazonaws.com"
}
}
}
]
}
BlocNotes已停止
答案 0 :(得分:1)
要解决此问题,请转到S3存储桶并按以下所示更新存储桶策略:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::632293491421:role/EMR_DefaultRole"
},
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::aws-emr-resources-632293491421-eu-west-1"
]
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::632293491421:role/EMR_DefaultRole"
},
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::aws-emr-resources-632293491421-eu-west-1/*"
]
}
]
}
以下屏幕截图可能会有所帮助!
答案 1 :(得分:0)
您的策略中已经有“ s3:*”,此名称适用于S3存储桶
明确地包含存储区ARN和文件夹路径
arn:aws:s3 ::: bucket
arn:aws:s3 ::: bucket / *
在EMR控制台中创建笔记本时,还要在路径中指定一个文件夹
答案 2 :(得分:0)
我只是遇到了同样的问题,当我手动将“ notesbooks”文件夹添加到S3驱动器时,它可以工作。
答案 3 :(得分:0)
要创建EMR_Notebooks_DefaultRole
,请选择Create default role
If a notebook has not been created before, you can choose to create the default role.