All Projects → Cloudniite → cloudniite

Cloudniite / cloudniite

Licence: MIT license
AWS Lambda Optimization and Monitoring Tool

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to cloudniite

cloudwatch-dashboards-cloudformation-sample
A sample project to demonstrate using Cloudformation, how to create and configure CloudWatch metric filters, alarms and a dashboard to monitor an AWS Lambda function.
Stars: ✭ 61 (+144%)
Mutual labels:  cloudformation, cloudwatch
Awesome Aws
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.
Stars: ✭ 9,895 (+39480%)
Mutual labels:  cloudformation, cloudwatch
monitoring-jump-start
Monitor AWS resources with ease
Stars: ✭ 67 (+168%)
Mutual labels:  cloudformation, cloudwatch
go-localstack
Go Wrapper for using localstack
Stars: ✭ 56 (+124%)
Mutual labels:  cloudformation, cloudwatch
aws-cfn-custom-resource-lambda-edge
🏗 AWS CloudFormation custom resource that allows deploying Lambda@Edge from any region
Stars: ✭ 19 (-24%)
Mutual labels:  cloudformation
aws-node-custom-user-pool
Serverless AWS Cognito Custom User Pool Example
Stars: ✭ 15 (-40%)
Mutual labels:  cloudformation
atlantis
GitOps for Teams (experimental hard fork of atlantis)
Stars: ✭ 13 (-48%)
Mutual labels:  cloudformation
vue-cloudwatch-dashboard
A simple live dashboard for CloudWatch metrics
Stars: ✭ 98 (+292%)
Mutual labels:  cloudwatch
aws-maven-plugin
Deploys resources to AWS using maven
Stars: ✭ 25 (+0%)
Mutual labels:  cloudformation
typeformation
Type Cloudformation templates with pleasure!
Stars: ✭ 16 (-36%)
Mutual labels:  cloudformation
aws-cloudformation-cognito-identity-pool
A Lambda-backed Custom Resource for a Cognito Identity Pool in CloudFormation
Stars: ✭ 35 (+40%)
Mutual labels:  cloudformation
nfscan
NFScan is a free, open-source software, available to non-profit organizations to receive donations effectively.
Stars: ✭ 85 (+240%)
Mutual labels:  cloudformation
bora
A Ruby command line tool and rake tasks for working with cloudformation stacks and cfndsl
Stars: ✭ 18 (-28%)
Mutual labels:  cloudformation
Humidifier
AWS Cloudformation using C#
Stars: ✭ 45 (+80%)
Mutual labels:  cloudformation
takomo
Organize, parameterize and deploy your CloudFormation stacks
Stars: ✭ 27 (+8%)
Mutual labels:  cloudformation
Hands-On-Serverless-Applications-with-Go
Hands-On Serverless Applications with Go, published by Packt.
Stars: ✭ 92 (+268%)
Mutual labels:  cloudformation
aws-cloudformation-resource-providers-cloudformation
The CloudFormation Resource Provider Package For AWS CloudFormation
Stars: ✭ 42 (+68%)
Mutual labels:  cloudformation
CloudGenesis
Automation for deploying & deleting CloudFormation stacks sourced from a Git repo
Stars: ✭ 34 (+36%)
Mutual labels:  cloudformation
LambdaSharpTool
Serverless .NET on AWS - λ# is a CLI and Framework for Rapid Application Development using .NET on AWS
Stars: ✭ 99 (+296%)
Mutual labels:  cloudformation
serverless-cloudformation-sub-variables
Serverless framework plugin for easily supporting AWS CloudFormation Sub intrinsic function variables
Stars: ✭ 25 (+0%)
Mutual labels:  cloudformation

Cloudniite·GitHub license npm version Twitter URL

Cloudniite is a JavaScript library that helps you as a developer optimize and monitor your serverless application performance and metrics on AWS Lambda. We chose AWS because it has an exceptional ecosystem of cloud products and a huge community of developers that are passionate about the future of serverless. We integrate seamlessly with your application to help you ensure your customers are having a fast and responsive experience. We do this by helping you organize and monitor event-driven AWS Lambda functions. If you are unfamiliar with AWS Lambda, no need to worry, we will cover the core concepts in the next section.

demo gif

Learn how to use Cloudniite in your own project.

How do you optimize AWS Lambda functions?

Amazon has to prepare or spin-up, new virtual servers to run your code. This startup time only happens when your functions haven't been run in a while. For Amazon, it doesn't make sense to keep your function running on a server if no one is using it. So, after a period of time, if your function isn't used, Amazon will "destroy" the server it is living on. This function will now be considered "cold". Cold functions take longer to run and will leave your users waiting longer for a response because of the time it takes to spin up a server to host the function.

Developers have been using simple timers to "warmup" their functions so that they stay running and available for users. This solution works but we believed there could be a smarter way to manage and keep your Lambda functions warm and performant.

Installation

Cloudniite is available as the cloudniite package on npm.

npm install --save cloudniite

Getting Started

Creating a function

To minimize execution duration and cost, add an if statement to check if Cloudniite has invoked the funtion. This will warm-up the funtion without running the function logic

Two options for creating a function:

  • Manually in your text editor
  • Inside AWS Lamda function creator

Option 1: Manually in your text editor

  • Text editor
  • AWS Lamda function creator
Yaml file *optional:

Recommended to add FunctionName: func at the bottom of the function in the yaml to create a custom name.

  • Otherwise, AWS CloudFormation generates a unique physical ID to name a resource.

  • this ID is the name of your function in AWS.

  • to refer to the function in our library you MUST use the function name in AWS.

  • exception: If you reuse templates to create multiple stacks, you must change or remove custom names from your template.

example:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
  func:
    Type: AWS::Serverless::Function
    Properties:
      Handler: lambda.handler
      Runtime: nodejs8.10
      Environment: 
        Variables:
          S3_BUCKET: bucketName
      FunctionName: func 
Lambda file:
exports.handler = function(event, context, callback) {
    if (event.source === "Cloudniite-Warmup") {
        callback(null,"Warmup");
    } else {
         ....add lambda logic here
    }
}

Make sure both yaml and lambda files are in the same folder.

Option 2: Inside AWS Lamda function creator

  • Text editor
  • AWS Lamda function creator

Setting up your server

const express = require('express');
const cloudniite = require('cloudniite');
configure(region,poolId, apiVersion = optional):

*default apiVersion is 2015. *Advice: if there is a config error, verify that the internet is working.

Configure returns a promise. If you wish to warm up on server start, use the .then method to invoke the other methods.

cloudniite.configure('region','poolId').then(() => {
//add methods here
});

Methods

Cloudniite lets you easily group your Lambda functions however you like. If you want to make sure all the Lambda functions associated with your landing page are warmed up, simply create a tag group passing in the functions you would like to be grouped together.

createTagGroup(tagGroup, functionName):
  • add as many functions as you want
    • if you want to add an array rather then individual functions, add a spread operator cloudniite.createTagGroup(#tagName, … [functionName1, functionName2, functionName3])
  • must be a string
cloudniite.createTagGroup("#tagGroup", "function1", "function2")

Then, whenever you want to warmup the LandingPage functions, just call our method passing in the tag group name.

warmupTagGroup(interval, tagGroup):

To warm up your function on a recurring timer, add an interval

  • intervals are set in minutes
  • null: no interval
cloudniite.warmupTagGroup(null,"#tagGroup"); 

You can also warm up individuals functions

warmupFunctions(interval, tagGroup):
  • intervals are set in minutes
  • null: no interval
cloudniite.warmupFunctions(null,"functionName"); 
Recomended:

Create a tag group for all the lambda functions on a route and call the warmupTagGroup method as middleware!

Visualizer

Here you can see:

  • List of all Tag Groups and the functions associated
  • List of all your functions
  • Graphs to help you decide when to use intervals for each function or tag group
  • and more...

To access the visualizer add a custom route to your server.

app.get('/getHtmlViz', cloudniite.getHtmlViz);

Go to the route on your port

  • URL format: port/getHtmlViz
example: http://localhost:3000/getHtmlViz

Authors

  • Linda Harrison - Initial work - GitHub
  • Stephen Grable - Initial work - GitHub
  • Muhammad Sheikh - Initial work - GitHub

License

Cloudniite is MIT licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].