Example of a foreign table with invoker authorization | Teradata Vantage - Example: Specifying an Invoker Authorization for a Foreign Table - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

In this example, an authorization with invoker trusted credentials is associated with a foreign table. Only the user who creates the authorization object can read from the associated foreign table.

This statement creates an authorization InvAuth_S3 with invoker trusted credentials. See CREATE AUTHORIZATION and REPLACE AUTHORIZATION.

CREATE AUTHORIZATION InvAuth_S3
 AS INVOKER TRUSTED
     USER 'YOUR-ACCESS-KEY-ID'
     PASSWORD 'YOUR-SECRET-ACCESS-KEY';

This statement creates the foreign table sensordata1 and specifies the authorization InvAuth_S3.

CREATE FOREIGN TABLE sensordata1, 
 EXTERNAL SECURITY INVOKER TRUSTED InvAuth_S3
USING ( 
         LOCATION ('/S3/YOUR-BUCKET.s3.teradata.com') 
      );