Amazon S3 for Snowflake

Prerequisite

Create an S3 bucket you want Sortment to give access to. This bucket URI will be required when creating policy and role for bucket access.

To give Sortment access to S3 bucket on your AWS account, follow these steps to create an account:

Configuring Access Key

The Access Key access type allows you to configure Sortment to use an IAM user by providing the user's Access Key ID and Secret Access Key.

If you need help generating these keys, consult the IAM article on this topic.

Once you have an Access Key ID and Secret Access Key, paste those values into the form and click Create.

Creating Stage in Snowflake

Once the credentials are created, you need to create a stage in Snowflake to allow creation of S3 connection. Use the following snippet to create the stage.

Ensure that the stage name is set as sortment.

-- Set variables
set bucket_url='s3://sortment/folder';
set aws_key_id='REPLACE_WITH_YOUR_AWS_KEY';
set aws_secret_key='REPLACE_WITH_YOUR_AWS_SECRET_KEY';

-- Set role for grants
USE ROLE ACCOUNTADMIN;

-- Create stage for Sortment
CREATE OR REPLACE STAGE sortment
  URL=$bucket_url
  CREDENTIALS=(AWS_KEY_ID=$aws_key_id AWS_SECRET_KEY=$aws_secret_key)
  file_format = (type = csv field_optionally_enclosed_by='"' compression = none)

Setting up the credentials

Use the credentials generated above to connect Sortment to your S3 bucket and proceed.

Last updated