Connect Snowflake to S3 Storage via Key/Secret
In this tutorial we will show how to generate a key and secret for an S3 bucket and then use that in Snowflake to create a stage.
Requirements
- Snowflake account, you can use a free trial. We also assume no complex security needs.
- AWS account, you can setup a free account to get started.
Video
Video in development.
Download
- Sample data (Link)
AWS
Sign into your aws account.
If you don't have a bucket yet follow here
Search S3 in the navigation bar.

Lets start by selecting the bucket we want Snowflake to access.

We'll first copy our ARN by going to properties.

If we have a new bucket, we can take the time here to upload the sample data.

Access Policy
Lets setup a read policy that we later apply to a user that will then be used by Snowflake to access the bucket. Search and click on "IAM".

Next we'll want to click json and add the JSON below and updating our ARN.
This is what it will look like.

Give the policy a name, make sure to remember this name we will need it later. Click "Create Policy".

Create User
Lets create the user and apply the policy to it. Start by going to users.

Now will select "Attach policies directly", search and select our policy, and click next.

Key/Secret Generation
Now that we have our user lets generate our credientals. Select the user.

Go to "Security credentials" and then click "create access key".

Select other and then click next.

Copy your access key and secret we will use this in Snowflake in the next step.

Snowflake
Lets now head into Snowflake and create a sql sheet in workspaces.
If you don't have a database, schema or warehouse yet.
```sql linenums="1"
-- Create a database to store our schemas.
create database if not exists raw;
-- Create the schema. The schema stores all objects.
create schema if not exists raw.aws;
/*
Warehouses are synonymous with the idea of compute
resources in other systems. We will use this
warehouse to query our integration and to load data.
*/
create warehouse if not exists development
warehouse_size = xsmall
auto_suspend = 30
initially_suspended = true;
use database raw;
use schema aws;
use warehouse development;
```
From here we'll add our stage code and paste in our bucket name, key and secret. Click run.
This is what it will look like once ran.

Now that we have created our stage we can go view the files in it. If you don't see the file right away, hit refresh. From here we can start loading data. But the process is the same as our S3 tutorial and not need to repeat here.











