Lake Formation, cross-account sharing for VIEW

0

Hi, I am trying to share a View from AccountA to AccountB using Lake Formation.

But it seems the shared view is trying to refer resources in the Target Account (AccountB) instead of Source Account (AccountA).

### Account A
## 1. Create source table in Database main
CREATE TABLE tmp_main_table AS
SELECT '123' as my_column;

## 2. Create view in Database main
CREATE VIEW vw_main AS
SELECT * FROM tmp_main_table;

## 3. Share Table And View to Account B using LF-Tag
GRANT SELECT ON ...


### Account B
## 1. Create Resource Link named `target_main` referring to shared `main` database

## 2. Select the View via Athena from `target_main` database
SELECT * FROM vw_main

ERROR:
INVALID_VIEW: line 1:15: Failed analyzing stored view 'awsdatacatalog.target_main.vw_main': line 3:3: Table 'awsdatacatalog.main.tmp_main_table' does not exist
This query ran against the "target_main" database, unless qualified by the query. Please post the error message on our forum 
or contact customer support 
with Query Id: 50de57c3-1599-47e5-9846-4afbff003418

Is this the expected behavior for cross-account sharing on View resource? Did I miss some basic configuration here?

Thanks

dev01
已提问 5 个月前310 查看次数
2 回答
0

Hi,

All LakeFormation cross-account sharing mechanisms are detailled here: https://docs.aws.amazon.com/lake-formation/latest/dg/cross-account-permissions.html

This blog post will provide you with very detailled guidance on achieving such data sharing across accounts: https://aws.amazon.com/blogs/big-data/securely-share-your-data-across-aws-accounts-using-aws-lake-formation/

Best,

Didier

profile pictureAWS
专家
已回答 5 个月前
profile picture
专家
已审核 5 个月前
0

By using lakeformation you can cross your "tables and view", unfortunately I see you can't share only view without exposing tables source..also is needed to create resource link in order to query data.. futermore it seems that view definition store original database from source and your destiny has database "resource link"..using clasic methodt to cross account..so.. it fail in my case again

Elvin
已回答 3 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则