Blogs

Creating Snow pipe on AWS

Purpose of the article: In this blog, we have explained how we can implement snow pipe in AWS cloud.

Intended Audience: This POC/Blog will help which kinds of people, like developers working on AWS and snowflake cloud

Tools and Technology: AWS services, Snowflake

Key words: Creating snow pipe by using snowflake on AWS

Objective:

To establish the Snowflake Snow pipe on an AWS stage.

Snow pipe: 

  • It’s a Snowflake continuous data ingestion service.
  • It loads data within minutes once after files are added to a stage and submitted for ingestion.
  • It enables loading data from files as soon as they’re available during a stage.

Advantages of Snow pipe:

  • Snow pipe constantly offers fresh business data across all departments while avoiding workload issues.
  • It is extremely cost-effective and charges customers per second with supported computing time.
  •  Snow pipe is extremely adaptable and enables simple customizations to load data.

The architecture of Snow pipe in AWS:

Steps to implement Snow pipe:

Step 1: Steps to make S3 Bucket in AWS:

  1. Log into the AWS Management Console.
  2. From the house dashboard, choose buckets
  1. Click on the’ create bucket’ option
  2. Set the bucket name as healthcaredata and choose the region for storing it.
  3. For block public access settings, select the choice ‘Block all public access’ and set Bucket versioning and Default encryption to Disable. And now create the bucket.

Step 2: Steps to make Policy in IAM:

  1. From the house dashboard, choose IAM (Identity & Access Management)
  2. Choose a policy and click create a new policy
  3. Choose JSON and use code below given.
  1. Click on Next tags and Next review; set the policy name healthcare-Policy and make the policy.

    Step 3: Steps to make User in IAM:

  1. From the house dashboard, choose IAM (Identity & Access Management).
  2. Choose the user, click on the create user option, and set the username as snowpipeingest-user.
  1. Choose Programmatic access in Access type and click on the Next Permission.
  2. Click on Attach existing policies directly then select the policy created earlier named as healthcaredata-Policy and click on Next tags.
  1. Create the user and download the CSV file, which has the access key ID and secret access key.

Step 4: Creating a table in Snowflake:

  1. Redirect to the Snowflake account.
  2. Create a table in Snowflake to store the knowledge.

3. Create a stage using S3 bucket name with a proper file format that’s visiting be loaded.

  1. Creating a pipe (HEALTHCARE_SNOWPIPE_LOAD) using the stage layer (HEALTHCAREDATA_STAGE)
  1. Use the show pipes command and replica the Arn code from the notification channel column values

     SHOW PIPES;

  1. Redirect to the S3 bucket page and choose the event notification under the properties.
  2. Click on the Event notifications and choose create event notifications.
  3. Set the event name as snowdailyingest-event and choose the All object create an event from Event Types.

 9. Upload the files into s3 bucket.

 10. Redirect to snowflake and query the table to verify to ingest the data

In the Snowflake table, files are successfully loaded.

Step 5: Status of Snow pipe:

The status of the pipe to retrieve the current status.

Author Bio:

Picture of Jyothi MODI

Jyothi MODI

Associate Software Engineer

An energetic, diligent and motivated person with a passion for innovation, Jyothi has 1+ years of experience in CHEP US automation project. She is also technically adept in Snowflake, AWS, Python, Flask, Matillion, ML, and Ms SQL.

Leave A Comment

Related Post

Purpose to Contact :
Purpose to Contact :
Purpose to Contact :

Purpose to Contact :
Purpose to Contact :
Purpose to Contact :

Purpose to Contact :