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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南