Code Monkey home page Code Monkey logo

cucloud-js's Introduction

CUCloud (Node.js)

js-standard-style

Overview

CUCloud (Node.js) is an implementation of the Cornell Cloud Library Spec. It is designed for use with invoked scripts or deployment in AWS Lambda.

  • Requires Node.js v4.3+
  • Uses AWS DynamoDB to store configuration.
  • Extensible plugin based model.

Getting Started

CUCloud (Node.js) uses the AWS SDK for JavaScript and stores configuration in a DynamoDB table named cucloud_config. Before using the module with any plugins, you'll need to initialize the schema. For details about the schema, see SCHEMA.md.

Install

CUCloud (Node.js) is not available via npm, but you can install it locally for yourself.

# fork, then clone the repository from your account
git clone [email protected]:<YOURUSERNAME>/cucloud-js.git

# install the modules dependencies
cd cucloud-js
npm install

# install the module globally for yourself
npm install . -g
npm link

AWS Credentials

Review Setting AWS Credentials before initializing the schema. When invoking the module, you will need access to DynamoDB be via your IAM user or a role.

Broad IAM policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "dynamodb:*"
      ],
      "Resource": "*"
    }
  ]
}

Initialize Schema

Initialize the DynamoDB schema using the model defined in examples/schema.yml

# use environmental variable or set the profile at runtime
export CUCLOUD_PROFILE=<profile-name>

# import the schema
cucloud-js-schema import examples/schema.yml [--profile <profile-name> ]

Export Schema

If at any point you would like to export your schema you can dump the configuration in YAML format. You can later import this export as needed.

# use environmental variable CUCLOUD_PROFILE= or set the profile at runtime
cucloud-js-schema export examples/prod-schema-export.yml [--profile <profile-name> ]

Plugins

CUCloud (Node.js) is designed to be used with plugins.

  • CUCloud.plugins.cnamer -
  • CUCloud.plugins.gitHubHookSns -

Examples

Implementations of the plugins are included in examples/. Documentation is included in doc/.

  • examples/lambda-cnamer.js - An AWS Lambda function to update a Route53 CNAME record with the public DNS of an EC2 instance when it enters a RUNNING state. For more detail see LAMBDA-CNAMER.md.
  • examples/lambda-snshook.js - AWS Lambda function to maintain the "Amazon SNS" service hook on all repositories for a GitHub organization. For more detail see LAMBDA-SNSHOOK.md.

Future

Future features under consideration...

  • expanded command line management of configuration.
  • schema export/import should be first level methods of CUCloud
  • options to reserve namespace
  • Expand out of the box environmental variable support.
  • Potential integrate with Claudia.JS

cucloud-js's People

Contributors

ericgrysko avatar

Watchers

 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.