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달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠