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
gefragt vor 5 Monaten310 Aufrufe
2 Antworten
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
EXPERTE
beantwortet vor 5 Monaten
profile picture
EXPERTE
überprüft vor 5 Monaten
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
beantwortet vor 3 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen