Amazon Redshift is a petabyte-scale, enterprise-grade cloud information warehouse service delivering the very best price-performance. Immediately, tens of 1000’s of consumers run business-critical workloads on Amazon Redshift to cost-effectively and rapidly analyze their information utilizing normal SQL and current enterprise intelligence (BI) instruments.
Amazon Redshift now makes it simpler so that you can run queries in AWS information lakes by mechanically mounting the AWS Glue Knowledge Catalog. You not should create an exterior schema in Amazon Redshift to make use of the information lake tables cataloged within the Knowledge Catalog. Now, you need to use your AWS Identification and Entry Administration (IAM) credentials or IAM position to browse the Glue Knowledge Catalog and question information lake tables straight from Amazon Redshift Question Editor v2 or your most well-liked SQL editors.
This function is now out there in all AWS business and US Gov Cloud Areas the place Amazon Redshift RA3, Amazon Redshift Serverless, and AWS Glue can be found. To study extra about auto-mounting of the Knowledge Catalog in Amazon Redshift, consult with Querying the AWS Glue Knowledge Catalog.
Enabling simple analytics for everybody
Amazon Redshift helps tens of 1000’s of consumers handle analytics at scale. Amazon Redshift gives a strong analytics resolution that gives entry to insights for customers of all ability ranges. You may make the most of the next advantages:
- It allows organizations to investigate numerous information sources, together with structured, semi-structured, and unstructured information, facilitating complete information exploration
- With its high-performance processing capabilities, Amazon Redshift handles massive and complicated datasets, guaranteeing quick question response instances and supporting real-time analytics
- Amazon Redshift supplies options like Multi-AZ (preview) and cross-Area snapshot copy for top availability and catastrophe restoration, and supplies authentication and authorization mechanisms to make it dependable and safe
- With options like Amazon Redshift ML, it democratizes ML capabilities throughout quite a lot of person personas
- The flexibleness to make the most of completely different desk codecs corresponding to Apache Hudi, Delta Lake, and Apache Iceberg (preview) optimizes question efficiency and storage effectivity
- Integration with superior analytical instruments empowers you to use subtle strategies and construct predictive fashions
- Scalability and elasticity enable for seamless growth as information and workloads develop
General, Amazon Redshift empowers organizations to uncover helpful insights, improve decision-making, and acquire a aggressive edge in at present’s data-driven panorama.

Amazon Redshift High Advantages
The brand new computerized mounting of the AWS Glue Knowledge Catalog function allows you to straight question AWS Glue objects in Amazon Redshift with out the necessity to create an exterior schema for every AWS Glue database you wish to question. With computerized mounting the Knowledge Catalog, Amazon Redshift mechanically mounts the cluster account’s default Knowledge Catalog throughout boot or person opt-in as an exterior database, named awsdatacatalog
.
Related use instances for computerized mounting of the AWS Glue Knowledge Catalog function
You need to use instruments like Amazon EMR to create new information lake schemas in numerous codecs, corresponding to Apache Hudi, Delta Lake, and Apache Iceberg (preview). Nonetheless, when analysts wish to run queries in opposition to these schemas, it requires directors to create exterior schemas for every AWS Glue database in Amazon Redshift. Now you can simplify this integration utilizing computerized mounting of the AWS Glue Knowledge Catalog.
The next diagram illustrates this structure.
Answer overview
Now you can use SQL shoppers like Amazon Redshift Question Editor v2 to browse and question awsdatacatalog
. In Question Editor V2, to hook up with the awsdatacatalog
database, select the next:
Full the next high-level steps to combine the automated mounting of the Knowledge Catalog utilizing Question Editor V2 and a third-party SQL shopper:
- Provision sources with AWS CloudFormation to populate Knowledge Catalog objects.
- Join Redshift Serverless and question the Knowledge Catalog as a federated person utilizing Question Editor V2.
- Join with Redshift provisioned cluster and question the Knowledge Catalog utilizing Question Editor V2.
- Configure permissions on catalog sources utilizing AWS Lake Formation.
- Federate with Redshift Serverless and question the Knowledge Catalog utilizing Question Editor V2 and a third-party SQL shopper.
- Uncover the auto-mounted objects.
- Join with Redshift provisioned cluster and question the Knowledge Catalog as a federated person utilizing a third-party shopper.
- Join with Amazon Redshift and question the Knowledge Catalog as an IAM person utilizing third-party shoppers.
The next diagram illustrates the answer workflow.
Stipulations
It is best to have the next stipulations:
Provision sources with AWS CloudFormation to populate Knowledge Catalog objects
On this submit, we use an AWS Glue crawler to create the exterior desk ny_pub
saved in Apache Parquet format within the Amazon Easy Storage Service (Amazon S3) location s3://redshift-demos/information/NY-Pub/
. On this step, we create the answer sources utilizing AWS CloudFormation to create a stack named CrawlS3Source-NYTaxiData
in both us-east-1
(use the yml obtain or launch stack) or us-west-2
(use the yml obtain or launch stack). Stack creation performs the next actions:
- Creates the crawler
NYTaxiCrawler
together with the brand new IAM positionAWSGlueServiceRole-RedshiftAutoMount
- Creates
automountdb
because the AWS Glue database
When the stack is full, carry out the next steps:
- On the AWS Glue console, underneath Knowledge Catalog within the navigation pane, select Crawlers.
- Open
NYTaxiCrawler
and select Run crawler.
After the crawler is full, you possibly can see a brand new desk referred to as ny_pub
within the Knowledge Catalog underneath the automountdb
database.
Alternatively, you possibly can observe the handbook directions from the Amazon Redshift labs to create the ny_pub
desk.
Join with Redshift Serverless and question the Knowledge Catalog as a federated person utilizing Question Editor V2
On this part, we use an IAM position with principal tags to allow fine-grained federated authentication to Redshift Serverless to entry auto-mounting AWS Glue objects.
Full the next steps:
- Create an IAM position and add following permissions. For this submit, we add full AWS Glue, Amazon Redshift, and Amazon S3 permissions for demo functions. In an precise manufacturing state of affairs, it’s advisable to use extra granular permissions.
- On the Tags tab, create a tag with Key as
RedshiftDbRoles
and Worth asautomount
. - In Question Editor V2, run the next SQL assertion as an admin person to create a database position named
automount
: - Grant utilization privileges to the database position:
- Change the position to
automountrole
by passing the account quantity and position identify. - Within the Question Editor v2, select your Redshift Serverless endpoint (right-click) and select Create connection.
- For Authentication, choose Federated person.
- For Database, enter the database identify you wish to hook up with.
- Select Create connection.
You’re now able to discover and question the automated mounting of the Knowledge Catalog in Redshift Serverless.
Join with Redshift provisioned cluster and question the Knowledge Catalog utilizing Question Editor V2
To attach with Redshift provisioned cluster and entry the Knowledge Catalog, be sure you have accomplished the steps within the previous part. Then full the next steps:
- Hook up with Redshift Question Editor V2 utilizing the database person identify and password authentication methodology. For instance, hook up with the
dev
database utilizing the admin person and password. - In an editor tab, assuming the person is current in Amazon Redshift, run the next SQL assertion to grant an IAM person entry to the Knowledge Catalog:
- As an admin person, select the Settings icon, select Account settings, and choose Authenticate with IAM credentials.
- Select Save.
- Change roles to
automountrole
by passing the account quantity and position identify. - Create or edit the connection and use the authentication methodology Short-term credentials utilizing your IAM id.
For extra details about this authentication methodology, see Connecting to an Amazon Redshift database.
You’re able to discover and question the automated mounting of the Knowledge Catalog in Amazon Redshift.
Uncover the auto-mounted objects
This part illustrates the SHOW instructions for discovery of auto-mounted objects. See the next code:
Configure permissions on catalog sources utilizing AWS Lake Formation
To keep up backward compatibility with AWS Glue, Lake Formation has the next preliminary safety settings:
- The
Tremendous
permission is granted to the groupIAMAllowedPrincipals
on all current Knowledge Catalog sources - The Use solely IAM entry management setting is enabled for brand spanking new Knowledge Catalog sources
These settings successfully trigger entry to Knowledge Catalog sources and Amazon S3 places to be managed solely by IAM insurance policies. Particular person Lake Formation permissions will not be in impact.
On this step, we are going to configure permissions on catalog sources utilizing AWS Lake Formation. Earlier than you create the Knowledge Catalog, you should replace the default settings of Lake Formation in order that entry to Knowledge Catalog sources (databases and tables) is managed by Lake Formation permissions:
- Change the default safety settings for brand spanking new sources. For directions, see Change the default permission mannequin.
- Change the settings for current Knowledge Catalog sources. For directions, see Upgrading AWS Glue information permissions to the AWS Lake Formation mannequin.
For extra data, consult with Altering the default settings on your information lake.
Federate with Redshift Serverless and question the Knowledge Catalog utilizing Question Editor V2 and a third-party SQL shopper
With Redshift Serverless, you possibly can hook up with awsdatacatalog
from a third-party shopper as a federated person from any id supplier (IdP). On this part, we are going to configure permission on catalog sources for Federated IAM position in AWS Lake Formation. Utilizing AWS Lake Formation with Redshift, presently permission may be utilized on IAM person or IAM position stage.
To attach as a federated person, we shall be utilizing Redshift Serverless. For setup directions, consult with Single sign-on with Amazon Redshift Serverless with Okta utilizing Amazon Redshift Question Editor v2 and third-party SQL shoppers.
There are extra modifications required on following sources:
- In Amazon Redshift, as an admin person, grant the utilization to every federated person who wants entry on
awsdatacatalog
:
If the person doesn’t exist in Amazon Redshift, chances are you’ll have to create the IAM person with the password disabled as proven within the following code after which grant utilization on awsdatacatalog
:
- On the Lake Formation console, assign permissions on the AWS Glue database to the IAM position that you simply created as a part of the federated setup.
- Beneath Principals, choose IAM customers and roles.
- Select IAM position
oktarole
. - Apply catalog useful resource permissions, deciding on
automountdb
database and granting acceptable desk permissions.
- Replace the IAM position used within the federation setup. Along with the permissions added to the IAM position, you should add AWS Glue permissions and Amazon S3 permissions to entry objects from Amazon S3. For this submit, we add full AWS Glue and AWS S3 permissions for demo functions. In an precise manufacturing state of affairs, it’s advisable to use extra granular permissions.
Now you’re prepared to hook up with Redshift Serverless utilizing the Question Editor V2 and federated login.
- Use the SSO URL from Okta and log in to your Okta account together with your person credentials. For this demo, we log in with person
Ethan
. - Within the Question Editor v2, select your Redshift Serverless occasion (right-click) and select Create connection.
- For Authentication, choose Federated person.
- For Database, enter the database identify you wish to hook up with.
- Select Create connection.
- Run the command
choose current_user
to validate that you’re logged in as a federated person.
Person Ethan
will have the ability to discover and entry awsdatacatalog
information.
To attach Redshift Serverless with a third-party shopper, be sure you have adopted all of the earlier steps.
For SQLWorkbench setup, consult with the part Configure the SQL shopper (SQL Workbench/J) in Single sign-on with Amazon Redshift Serverless with Okta utilizing Amazon Redshift Question Editor v2 and third-party SQL shoppers.
The next screenshot reveals that federated person ethan
is ready to question the awsdatacatalog
tables utilizing three-part notation:
Join with Redshift provisioned cluster and question the Knowledge Catalog as a federated person utilizing third-party shoppers
With Redshift provisioned cluster, you possibly can join with awsdatacatalog
from a third-party shopper as a federated person from any IdP.
To attach as a federated person with the Redshift provisioned cluster, you should observe the steps within the earlier part that detailed join with Redshift Serverless and question the Knowledge Catalog as a federated person utilizing Question Editor V2 and a third-party SQL shopper.
There are extra modifications required in IAM coverage. Replace the IAM coverage with the next code to make use of the GetClusterCredentialsWithIAM
API:
Now you’re prepared to hook up with Redshift provisioned cluster utilizing a third-party SQL shopper as a federated person.
For SQLWorkbench setup, consult with the part Configure the SQL shopper (SQL Workbench/J) within the submit Single sign-on with Amazon Redshift Serverless with Okta utilizing Amazon Redshift Question Editor v2 and third-party SQL shoppers.
Make the next modifications:
- Use the newest Redshift JDBC driver as a result of it solely helps querying the auto-mounted Knowledge Catalog desk for federated customers
- For URL, enter
jdbc:redshift:iam://<cluster endpoint>:<port>:<databasename>?groupfederation=true
. For instance,jdbc:redshift:iam://redshift-cluster-1.abdef0abc0ab.us-east-2.redshift.amazonaws.com:5439/dev?groupfederation=true
.
Within the previous URL, groupfederation
is a compulsory parameter that lets you authenticate with the IAM credentials.
The next screenshot reveals that federated person ethan
is ready to question the awsdatacatalog
tables utilizing three-part notation.
Join and question the Knowledge Catalog as an IAM person utilizing third-party shoppers
On this part, we offer directions to arrange a SQL shopper to question the auto-mounted awsdatacatalog
.
Use three-part notation to reference the awsdatacatalog desk in your SELECT assertion. The primary half is the database identify, the second half is the AWS Glue database identify, and the third half is the AWS Glue desk identify:
You may carry out numerous situations that learn the Knowledge Catalog information and populate Redshift tables.
For this submit, we use SQLWorkbench/J because the SQL shopper to question the Knowledge Catalog. To arrange SQL Workbench/J, full the next steps:
- Create a brand new connection in SQL Workbench/J and select Amazon Redshift as the driving force.
- Select Handle drivers and add all of the information from the downloaded AWS JDBC driver pack .zip file (keep in mind to unzip the .zip file).
You have to use the newest Redshift JDBC driver as a result of it solely helps querying the auto-mounted Knowledge Catalog desk.
- For URL, enter
jdbc:redshift:iam://<cluster endpoint>:<port>:<databasename>?profile=<profilename>&groupfederation=true
. For instance,jdbc:redshift:iam://redshift-cluster-1.abdef0abc0ab.us-east-2.redshift.amazonaws.com:5439/dev?profile=user2&groupfederation=true
.
We’re utilizing profile-based credentials for instance. You need to use any AWS profile or IAM credential-based authentication as per your requirement. For extra data on IAM credentials, consult with Choices for offering IAM credentials.
The next screenshot reveals that IAM person johndoe
is ready to checklist the awsdatacatalog
tables utilizing the SHOW command.
The next screenshot reveals that IAM person johndoe
is ready to question the awsdatacatalog
tables utilizing three-part notation:
For those who get the next error whereas utilizing groupfederation=true
, you should use the newest Redshift driver:
Clear up
Full the next steps to scrub up your sources:
- Delete the IAM position
automountrole
. - Delete the CloudFormation stack
CrawlS3Source-NYTaxiData
to scrub up the crawlerNYTaxiCrawler
, the automountdb database from the Knowledge Catalog, and the IAM positionAWSGlueServiceRole-RedshiftAutoMount
. - Replace the default settings of Lake Formation:
- Within the navigation pane, underneath Knowledge catalog, select Settings.
- Choose each entry management choices select Save.
- Within the navigation pane, underneath Permissions, select Administrative roles and duties.
- Within the Database creators part, select Grant.
- Seek for
IAMAllowedPrincipals
and choose Create database permission. - Select Grant.
Issues
Notice the next concerns:
- The Knowledge Catalog auto-mount supplies ease of use to analysts or database customers. The safety setup (establishing the permissions mannequin or information governance) is owned by account and database directors.
- To attain fine-grained entry management, construct a permissions mannequin in AWS Lake Formation.
- If the permissions should be maintained on the Redshift database stage, go away the AWS Lake Formation default settings as is after which run grant/revoke in Amazon Redshift.
- If you’re utilizing a third-party SQL editor, and your question instrument doesn’t assist searching of a number of databases, you need to use the “SHOW“ instructions to checklist your AWS Glue databases and tables. You can even question
awsdatacatalog
objects utilizing three-part notation (SELECT * FROM awsdatacatalog.<aws-glue-db-name>.<aws-glue-table-name>;
) offered you might have entry to the exterior objects primarily based on the permission mannequin.
Conclusion
On this submit, we launched the automated mounting of AWS Glue Knowledge Catalog, which makes it simpler for patrons to run queries of their information lakes. This function streamlines information governance and entry management, eliminating the necessity to create an exterior schema in Amazon Redshift to make use of the information lake tables cataloged in AWS Glue Knowledge Catalog. We confirmed how one can handle permission on auto-mounted AWS Glue-based objects utilizing Lake Formation. The permission mannequin may be simply managed and arranged by directors, permitting database customers to seamlessly entry exterior objects they’ve been granted entry to.
As we try for enhanced usability in Amazon Redshift, we prioritize unified information governance and fine-grained entry management. This function minimizes handbook effort whereas guaranteeing the required safety measures on your group are in place.
For extra details about computerized mounting of the Knowledge Catalog in Amazon Redshift, consult with Querying the AWS Glue Knowledge Catalog.
Concerning the Authors
Maneesh Sharma is a Senior Database Engineer at AWS with greater than a decade of expertise designing and implementing large-scale information warehouse and analytics options. He collaborates with numerous Amazon Redshift Companions and clients to drive higher integration.
Debu Panda is a Senior Supervisor, Product Administration at AWS. He’s an business chief in analytics, software platform, and database applied sciences, and has greater than 25 years of expertise within the IT world.
Rohit Vashishtha is a Senior Analytics Specialist Options Architect at AWS primarily based in Dallas, Texas. He has 17 years of expertise architecting, constructing, main, and sustaining huge information platforms. Rohit helps clients modernize their analytic workloads utilizing the breadth of AWS companies and ensures that clients get the very best worth/efficiency with utmost safety and information governance.