【发布时间】:2020-04-09 21:40:27
【问题描述】:
我想使用 Glue Crawler 从 S3 存储桶中抓取数据。此 S3 存储桶位于另一个 AWS 账户中。我们打电话给账户 A。我的 Glue Crawler 在账户 B 中。
我在账户 B 中创建了一个角色并将其命名为 AWSGlueServiceRole-Reporting 我附上了以下政策:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BucketAccess",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::AccountAbucketname"
]
},
{
"Sid": "ObjectAccess",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::AccountABucketName/Foldername/*"
]
}
]
}
还有AWSGlueServiceRole policy。
在拥有 S3 存储桶的账户 A 中,我附加了以下存储桶策略:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::AccountB:role/AWSGlueServiceRoleReporting”
},
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::AccountABucketName"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::AccountB:role/AWSGlueServiceRoleReporting”
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::AccountABucketName/FolderName/*"
}
]
}
我能够在账户 B 中的这个 S3 存储桶上运行 Glue Crawler,它创建了 Glue Tables。但是当我尝试在 Athena 中查询它们时,我得到了拒绝访问。
谁能帮我在 Athena 中查询它??
【问题讨论】:
标签: amazon-web-services amazon-s3 web-crawler aws-glue amazon-athena