Git Product home page Git Product logo

firehose-nodejs-example's Introduction

Kinesis Firehose Node.js example

What does this example do

The idea of this example is to have a node.js code that uses Amazon Kinesis Firehose to insert data do some Amazon Redshift table.

Because Firehose always sends data to a S3 bucket this example starts by creating one if it does not exist yet. The Firehose will be configured to send the data to a subfolder of your S3Bucket.

The steps followed by this example are the following: It...

  1. Creates a S3Bucket (if it does not exist) with a specific name configured by you;
  2. Connects directly to your Redshift Database and creates a table;
  3. Creates a Firehose Delivery Stream
  4. Waits for the status of the Delivery Stream recently created to change from Creating to Active
  5. Sends 1 record to the recently activated Firehose Delivery Stream
  6. Connects directly to your Redshift Database and queries the table created on the step 2 once every 1 minute and prints out the retrieved rows.

Installation

Simply clone the repo and install the modules using npm

git clone https://github.com/danielsan/firehose-nodejs-example.git
cd firehose-nodejs-example
npm install

Preparing

  1. You need to have a valid account on Amazon Web Services
  2. To run this example you will need to have your aws_access_key_id and your aws_secret_access_key within your ~/.aws/credentials file.
  3. You have to create your Redshift Cluster manually
  4. Once you have your cluster created connect to your Redshift Database using any valid client to create a user and password specifically for Firehose.
    • I to access your Redshift Database I use (and recommend) the SQL Workbench
    • You can go to the Cluster Connection URL to download the JDBC driver for Redshift and to see your JDBC Connection String as well.
    • Be sure to allow your ip address on redshift security settings
    • You'll also have to allow the Firehose servers of your region to access your Redshift Cluster.
  5. Copy the .env-dist file to a file named .env
  6. Edit your .env file and set the variables with your AWS, S3 and Redshift information.

Running

Once you have followed all the steps above you can run the project by following the npm pattern executiong npm start

npm start

firehose-nodejs-example's People

Contributors

danielsan avatar danielsanem avatar dependabot[bot] avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.