Setting up Unity Catalog Storage Credentials and External Locations for AWS S3
Summary
- Unified data governance: Unity Catalog provides centralized governance for all data and AI assets across cloud storage and multiple platforms.
- Storage credentials setup: Create storage credentials like AWS IAM roles to enable Unity Catalog to securely connect to external cloud storage.
- External locations: Configure external locations that combine storage credentials with cloud paths to control which users can access specific cloud storage.
Setting up Unity Catalog Storage Credentials and External Locations for AWS S3

Join Shreel Shah, a scale solutions engineer at Databricks, as he guides you through setting up Unity Catalog, storage credentials, and external locations to connect with AWS S3. Learn about data governance, security, and how to create tables from S3 data using Databricks. Learn more in Databricks documentation.
Chapters
0:00Introduction to unity catalog0:32Storage and location concepts1:28AWS IAM role configuration3:06Creating storage credentials3:45Setting up external locations4:31Data access and table creation
FAQs
What is a storage credential in Unity Catalog?
A storage credential enables Unity Catalog to connect to external cloud storage (like an AWS IAM role for S3) and controls which users can use the credential to access cloud resources.
What is the difference between storage credentials and external locations?
Storage credentials are credentials used to connect to cloud storage, while external locations combine a credential with a specific cloud storage path, providing more granular access control.
Why should you use external locations instead of direct storage credentials?
Using external locations is a best practice because it provides more granular access control, allowing you to restrict which users and groups can access specific cloud storage paths.
How do you create tables from S3 data using Unity Catalog?
First set up storage credentials and external locations pointing to your S3 bucket, then create tables from that external location within Unity Catalog for governance and access controls.
Full transcript
0:00 Introduction to unity catalog
Hey everyone, I'm a scale engineer here at data bricks and today we're going to talk about setting up unity catalog storage credentials and external locations in order to connect to AWS S3. So data bricks unity catalog is a unified and open governance for all data and AI assets. It allows you to connect to any external data source as well as has a bunch of features related to data security such as access control and auditing, data discovery, data lineage and observability tools such as cost controls and business semantics.
It is in open access and collabor and allows for collaboration with any tool engine or platform. In terms of connecting to AWS S3 or any cloud storage, there are two main components in terms of Unity catalog that we need to set up. The first one is a storage credential. A storage credential enables Unity catalog to connect to an external cloud store. It is access control to determine which users can use the storage credential and you can use one credential for multiple external locations.
0:32 Storage and location concepts
Some examples will include an IM role for AWS S3 and for Azure it's going to be a managed identity to connect to Azure storage accounts. External storage. An external location combines a cloud storage path with a storage credential in order to access the actual location on the bucket itself. An external location is used for accessing specific locations within a cloud store and it is also access control to determine which users and group can access that space.
It is generally best practice to not use storage credentials for direct access to the underlying location but rather to set up external locations instead. Now we will navigate over to the data bricks workspace in order to actually set up our storage credentials and external locations. So here I am on my data bricks UI and in order to actually set up the storage credentials and external locations over here I will navigate to the external data tab and from here I will navigate over to the credentials page.
This is where we will set up our storage credentials. So I will click on create credential and it'll pop up this UI where I'll actually register the AWS IM role. Now I've gone ahead and set up a sample IM RO on AWS. So if I navigate over to my AWS console, you will see that I have this data bricks demo ingestion IM ro set up. Within the trust relationships of this role, you will see that I have this JSON definition. And this is pretty much what we have in our public documentations as well.
1:28 AWS IAM role configuration
And a key thing to note is that on line 9 over here, we do need to make this IM ro self assuming. So I've gone ahead and added in the same ARN for this IM role. And on line 15 for the external ID, I've gone ahead and added in the storage credential external ID. Um, you can grab this from the workspace itself once you register the storage credential if you want to do so after the fact. Now, if I go back to my permissions tab, I will see that I have a data bricks demo in IM policy attached to this role.
So if we go ahead and open this up, we can take a look at that what that policy looks like. So over here we have our JSON policy for this IM policy. And you'll you'll see that over here underneath the resources section, I've specified two resources, which is going to be the name of the S3 bucket that I want this policy to read and write from. So the name of that S3 bucket that I have set up is data bricks demo in. And this slash star means that I want all the objects within this S3 bucket to be read and read and written from.
And I'm also given permissions on the actual bucket itself. And the rest of the policy follows as what we have in our documentation. So now going back to the IM role, what I will do is I will grab this ARN so that I can supply it to the data bricks UI. So now that we are back on the data bricks workspace uh on the create a new credential page, I will go ahead and give this credential a name. So I will call this datab bricks ingestion credential and I will go ahead and paste in that IM roll ARN that I copied.
3:06 Creating storage credentials
And once that has been copied and pasted, I will click the create button and it will say that the create credential has been created. This is the external ID. if you haven't already updated your trust policy. You can go ahead and replace that with this ID over here. But I've already done so. So I'll just click done. And awesome. My credential has been created. So what I'll do is validate the config configuration in the right hand side over here.
And as you can see, all the tests have passed. So I'll close this out. And what I'll do is go back to my catalog explorer. Click on the external data tab. And next, we can set up our actual external location. So as you recall, the external location is the actual path to the S3 itself. So I'll click on create external location. I'll go with the manual approach and I will give my external location a name. So I'll call it datab bricks injection-l for external location.
3:45 Setting up external locations
Storage type, this is an S3 bucket. And then for URL, this is going to be the actual path to the S3 bucket. So I will do S3 slash and then I will navigate over to my AWS section to get the name of my bucket. So this is the bucket that I have set up on AWS. The name of the bucket is data bricks-demo injection. And as you can see, there's just one CSV file within this S3 bucket. So I will copy over this name of the bucket and then go back over to datab bricks and then paste in that bucket name.
For storage credential from the drop down, I'll choose the storage credential that we just created. Awesome. And next, we can click create. Cool. So our external location has been set up. And what I'll do is test the connection to make sure everything looks good. And all the tests have passed, which means we should be good to go. I'll exit out of this. And from here, what I'll do is go over to the browse section, and we should see that we have that same CSV file that we saw on our AWS side.
4:31 Data access and table creation
From here, what we can do is create a table from the CSV file. So, I'll click on the create table. I will choose our CSV file and preview table. And as you can see, the UI has shown up, which will allow us to preview the data as well as choose which catalog schema and the name of the table that we want to write to. For this, I'll leave the catalog as demo workspace US East 1. The schema will be default and I'll change the name of the table to parks.
Awesome. So, as we can see, we have some sample data from the CSV file. If we wanted to preview it, we would just go here. But everything looks good to me. So, what I'll do is hit create table. And in a few seconds, our table should be created. Awesome. So, now navigating back over to our Unity catalog section underneath our demo workspace catalog. And within the default schema, we see that we have our parks table, which was created from the CSV from our S3 bucket.
If I go over to the sample data tab, I will see be able to preview some of that data that we saw as well as run any analytics or queries on top of it. So with that, we have successfully set up a connection to S3 using data bricks Unity catalog as well as storage credentials and external locations. Hope you found this video helpful. Thanks.
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.