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
asked 4 months ago293 views
2 Answers
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
EXPERT
answered 4 months ago
profile picture
EXPERT
reviewed 4 months ago
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
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions