简体   繁体   English

通过 Athena 跨账户访问 AWS Glue 数据目录

[英]Cross-account access to AWS Glue Data Catalog via Athena

是否可以通过账户A的 Athena 接口直接访问账户B 的AWS Glue 数据目录?

I was just trying to resolve this same issue in my own setup, but then stumbled across this bummer (the last bullet under Cross-Account Access Limitations on this page ):我只是想在我自己的设置中解决同样的问题,但后来偶然发现了这个无赖( 本页Cross-Account Access Limitations下的最后一个项目):

Cross-account access to the Data Catalog is not supported when using an AWS Glue crawler, Amazon Athena, or Amazon Redshift.

So it sounds like even with the cross-account access that is possible today, they won't naturally replicate through those services (including the asked about Athena).因此,听起来即使使用今天可能的跨账户访问,它们也不会自然地通过这些服务进行复制(包括询问有关 Athena 的问题)。

That said, I was able to set up cross-account access to the AWS Glue Data Catalog in a way that allowed me to use Account A to pull all relevant info about Data Catalog objects from Account B. I can update my answer to incorporate how far I got, if you want, but a hacky method that might solve this question would be to set up the cross-account access that is possible today then run a recurring Lambda function that replicates over all the relevant metadata in the Data Catalog from Account B to Account A so users in Account A can view that within Account A's AWS Glue Data Catalog.也就是说,我能够以允许我使用账户 A 从账户 B 中提取有关数据目录对象的所有相关信息的方式设置对 AWS Glue 数据目录的跨账户访问。我可以更新我的答案以合并如何到目前为止,如果您愿意,但可以解决这个问题的一种hacky 方法是设置今天可能的跨账户访问,然后运行一个重复的 Lambda 函数,该函数从 Account 复制数据目录中的所有相关元数据B 到账户 A,以便账户 A 中的用户可以在账户 A 的 AWS Glue 数据目录中查看。 I'm not sure whether Athena specifically would work in that setup, as I know it requires PutObject access when it queries data in S3 (which could be solved via the appropriate S3 bucket policies, but that'd be another cross-account permissions thing to manage).我不确定 Athena 是否特别适用于该设置,因为我知道它在查询 S3 中的数据时需要PutObject访问(这可以通过适当的 S3 存储桶策略解决,但这将是另一个跨账户权限问题管理)。

Let me know whether you'd like to see those details on what cross-account stuff I was able to get working.让我知道您是否希望查看有关我能够使用哪些跨账户内容的详细信息。

AWS 已开始使用 Lambda 支持此功能,请点击以下链接https://aws.amazon.com/blogs/big-data/cross-account-aws-glue-data-catalog-access-with-amazon-athena/

Since May 2021 it is now possible to register a data catalog from a different account in Amazon Athena, see the User Guide .自 2021 年 5 月起, 现在可以从 Amazon Athena 中的不同账户注册数据目录,请参阅用户指南

Athena Query Engine v2 is required though and there are some other limitations .虽然需要 Athena Query Engine v2,但还有一些其他限制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM