- Categories:
System functions (System Control)
SYSTEM$GET_ LISTING_ URL_ FOR_ EXTERNAL_ CONSUMER¶
Returns the connection details that an external consumer uses to connect to an external listing: the catalog name, catalog URI, OAuth scope, and OAuth token endpoint. The external consumer uses these values to connect with an Iceberg REST Catalog client.
Syntax¶
Arguments¶
Required:
'listing_name'Name of the external listing. The name must be enclosed in single quotes.
'external_consumer_name'Name of the external consumer to return the connection details for. The external consumer must be a target of the listing. The name must be enclosed in single quotes.
The connection details depend on the external consumer’s region, so a listing that targets consumers in different regions returns different values for each consumer.
Returns¶
Returns a JSON object containing the following fields:
| Field | Description |
|---|---|
catalog | The catalog name the external consumer uses to identify the shared data. |
catalog_uri | The Iceberg REST Catalog endpoint URL the external consumer uses to connect. |
scope | The OAuth scope required when requesting an access token for the Iceberg REST Catalog session. |
oauth_token_uri | The OAuth token endpoint URL the external consumer uses to obtain an access token for the catalog. |
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| OWNERSHIP or USAGE | Listing | Required to retrieve the connection details for the listing. |
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Usage notes¶
- The returned values depend on the external consumer’s region. Call the function separately for each external consumer.
- The external consumer authenticates with a programmatic access token (PAT) or workload identity federation (WIF), depending on how you configured the external consumer. For more information, see Workload identity federation for external consumers.
- Provide the
catalog,catalog_uri,scope, andoauth_token_urivalues to the external consumer, along with their PAT or workload identity details. The consumer sends token requests tooauth_token_uriand catalog requests tocatalog_uri. For instructions, see Connect to an open-sharing catalog.
Examples¶
Retrieve the connection details for the external consumer TEST_EXT_CONSUMER on the listing TEST_LISTING:
Example output for an external consumer in the provider account’s region:
Example output for an external consumer in the PUBLIC.AWS_EU_CENTRAL_1 region: