Creating a resource link to a shared Data Catalog table - Amazon Lake Formation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Creating a resource link to a shared Data Catalog table

You can create a resource link to a shared table in any Amazon Region by using the Amazon Lake Formation console, API, or Amazon Command Line Interface (Amazon CLI).

To create a resource link to a shared table (console)
  1. Open the Amazon Lake Formation console at https://console.amazonaws.cn/lakeformation/. Sign in as a principal who has the Lake Formation CREATE_TABLE permission on the database to contain the resource link.

  2. In the navigation pane, choose Tables, and then choose Create table.

  3. On the Create table page, choose the Resource Link tile, and then provide the following information:

    Resource link name

    Enter a name that adheres to the same rules as a table name. The name can be the same as the target shared table.

    Database

    The database in the local Data Catalog to contain the resource link.

    Shared table owner Region

    If you are creating the resource link in a different Region, select the region of the target shared table.

    Shared table

    Select a shared table from the list, or enter a local (owned) or shared table name.

    The list contains all the tables shared with your account. Note the database and owner account ID that are listed with each table. If you don't see a table that you know was shared with your account, check the following:

    • If you aren't a data lake administrator, check that the data lake administrator granted you Lake Formation permissions on the table.

    • If you are a data lake administrator, and your account is not in the same Amazon organization as the granting account, ensure that you have accepted the Amazon Resource Access Manager (Amazon RAM) resource share invitation for the table. For more information, see Accepting a resource share invitation from Amazon RAM.

    Shared table's database

    If you selected a shared table from the list, this field is populated with the shared table's database in the external account. Otherwise, enter a local database (for a resource link to a local table) or the shared table's database in the external account.

    Shared table owner

    If you selected a shared table from the list, this field is populated with the shared table's owner account ID. Otherwise, enter your Amazon account ID (for a resource link to a local table) or the ID of the Amazon account that shared the table.

    
            The Table details dialog box has the Resource link radio button selected, with
              the following fields filled in: Resource link name, Database, Shared table, Shared
              table's database, and Shared table owner ID. The last two fields are disabled
              (read-only).
  4. Choose Create to create the resource link.

    You can then view the resource link name under the Name column on the Tables page.

  5. (Optional) Grant the Lake Formation DESCRIBE permission on the resource link to principals that must be able to view the link and access the target table.

To create a resource link to a shared table in the same Region (Amazon CLI)
  1. Enter a command similar to the following.

    aws glue create-table --database-name myissues --table-input '{"Name":"my_customers","TargetTable":{"CatalogId":"111122223333","DatabaseName":"issues","Name":"customers"}}'

    This command creates a resource link named my_customers to the shared table customers, which is in the database issues in the Amazon account 1111-2222-3333. The resource link is stored in the local database myissues.

  2. (Optional) Grant the Lake Formation DESCRIBE permission on the resource link to principals that must be able to view the link and access the target table.

To create a resource link to a shared table in a different Region (Amazon CLI)
  1. Enter a command similar to the following.

    aws glue create-table —region eu-west-1 —cli-input-json '{ "CatalogId": "111122223333", "DatabaseName": "ireland_db", "TableInput": { "Name": "rl_useast1salestb_ireland", "TargetTable": { "CatalogId": "444455556666", "DatabaseName": "useast1_salesdb", "Region": "us-east-1", "Name":"useast1_salestb" } } }‘

    This command creates a resource link named rl_useast1salestb_ireland in the Europe (Ireland) Region to the shared table useast1_salestb, which is in the database useast1_salesdb in the Amazon account 444455556666 in the US East (N. Virginia) Region. The resource link is stored in the local database ireland_db.

  2. Grant the Lake Formation DESCRIBE permission to principals that must be able to view the link and access the link target through the link.