Coder Social home page Coder Social logo

kndt84 / lambda-dynamodb-bigquery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from runtakun/lambda-dynamodb-bigquery

0.0 2.0 0.0 11 KB

AWS Lambda function to insert DynamoDB records to Google BigQuery

License: MIT License

JavaScript 100.00%

lambda-dynamodb-bigquery's Introduction

lambda-dynamodb-bigquery

AWS Lambda function for insert DynamoDB records to Google BigQuery

How to build

This package depends on gcloud and it uses native code. So you have to build on Amazon Linux to execute AWS Lambda.

  • Launch new Amazon Linux instance

  • Install required packages to the instance

sudo yum update
sudo yum install git-core
sudo yum groupinstall "Development Tools"
  • Install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
  • Install Node.js
nvm install v0.10.44
  • Clone repository
git clone https://github.com/runtakun/lambda-dynamodb-bigquery.git
  • Change directory and install npm packages
cd lambda-dynamodb-bigquery
npm install
  • Add configuration file and account key file

  • Install grunt and build package

npm install -g grunt-cli
grunt lambda_package
  • Create AWS Lambda function and upload package

Create Lambda function in AWS console and speficy Node.js 0.10 in Runtime section.

Account key

Create service account at developer console (below link) and download key file.

https://console.cloud.google.com/permissions/serviceaccounts

Configuration

You should specify project name and dataset id by JSON file named gcpconfig.json.

Example:

{"project": "lambda-bigquery-sample", "dataset": "sample"}

Table name

By default, BigQuery table will be named with the same as DynamoDB's one. But you can specify specific name by configuration.

Example:

{"project": "lambda-bigquery-sample", "dataset": "sample", "table": "Sample"}

Table partitioning

You can use table partitioning by configuration field tablePartitionPeriod and specifing daily or monthly. You should create normal table before data is inserted. For example, if you creates table named Sample on BigQuery, BigQuery creates Sample20160401 table.

Example:

{"project": "lambda-bigquery-sample", "dataset": "sample", "tablePartitionPeriod": "monthly"}

THANKS

lambda-dynamodb-bigquery's People

Contributors

kndt84 avatar runtakun avatar

Watchers

 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.