0.3.4 • Published 8 years ago

amity-framework v0.3.4

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
8 years ago

amity framework

https://gitter.im/aletheia/amity Build Status

DISCLAIMER: Amity framework is still in ALPHA release, so something could need to be fixed. This means Amity is not intended to be ready for production projects, until release 1.0 is out.

Amity aims to be a fast and straightforward tool to create AWS functions and resources. Written completely in Node.js it relies only on aws sdk for NodeJS, thus exposing allthe functionalities of the project manager tool to be invoked at runtime.

Getting started

Amity can be installed as Node.js global module using NPM

npm install -g amity-framework

Usage

Amity can be used either as library from Node source file or with an handy Command Line Interface (CLI).

Amity Object (API)

Install locally in project using NPM

npm install --save-dev amity-framework

then require module in project and create a new instance

var Amity = require("amity-framework");

var projectPath = "path/to/project";
var amity = new Amity(projectPath);

Now, using init

amity.init();	// initialize project

can initialize a new project creating files and folders, while with create

amity.create(type , <name or id>, params, path);

new resources or functions. Function accepts four parameters:

  • type is the type of the resource that will be created:lambda|s3|sns|dynamodb

  • name or id is th name of the function to be created or the id corresponding to a specific resource inside the project. Used ids are project wide and stored by Amity

  • params is a config object containing resource

  • path project home path

Amity Command Line Interface (CLI)

amity init <project name>
amity create lambda <function name> -m memory -t timeout
amity create <resource type> <resource id in project> [-paramName:paramValue]
amity cloud deploy
amity cloud deploy <resource id>
amity cloud update <resource id>
amity cloud delete <resource id>

Amity folder structure

Amity relies on standardized project structure, to better organize files and folder. This structure is flexible and can be customized through amity.project.json file.

<project root>
	├─── cloud
	├─── code
	│       ├─── lambda
	│       └─── app
	├─── test
	└─── dist
  • cloud: contains all the cloud configurations that have to be considered project-wide.
  • code - lambda: contains all the functions that belong to this project, one in each folder. Cross-function resources can be configured here.
  • code - app: contains all the static code for any client app for this project. It will be deployed in an S3 bucket.
  • test: contains all the tests for this project, run through jasmine command.
  • dist: output folder, containing all the generated files.

What is Amity development status?

As stated before, Amity is a currently active work in progress. Visit the Amity Trello board to stay tuned on what's going on. Wanna contribute with some great idea? Join us to Amity Gitter chat and start discussing the feature you miss most.

Upcoming Amity releases

  • 0.3.0: Lambda functions creation and management
  • 0.4.0: Cloud resources creation from scratch
  • 0.5.0: Test coverage, CLI improvements, Cloud resources upgrade and delete production ready release
  • 0.6.0: Support for CloudSearch domains creation

Why Amity and not X?

X = Serverless (aka JAWS))

Amity took great inspiration from JAWS people and their idea of a cloud project manager made us dream of a better world. Unfortunately JAWS is really a complex project and has a big development cycle. Some basic assumptions (like using CloudFormation as a common middle layer) found our understanding, but not our approval: we were looking for a tool that can be used interactively within our projects and in the near future also as standalone Lambda function deployed on AWS (maybe exposing its capabilities through a set of REST APIs). Sounds cool, eh? Unfortunately Serverless approach cuts off this possibility both in the near and far future. This is not what we love and the way (in our very humble opinion) serverless projects will be managed. So, this meant we've to start over with a new project that could (hopefully) merge into JAWS/Serverless in the near future, adding Amity capabilities to every Serverless powered project.

Basically Amity differs from Serverless for a couple of capabilities:

  • provides JS Objects modeling AWS Resources
  • can be used in interactive mode (add/remove a single resource or function)
  • does not rely on CloudFormation Syntax (which can be cumbersome and does not allow for AWS services such as APIGateway and Cloudsearch)

Amity can be thought as Serverless little flexible brother: where Serverless aim to manage extremely big projects, with hundreds of functions, Amity holds a smaller approcah thus providing capabilities focused on mobile backend-less development, thus focusing on enabling support for features such as AWS SNS, IoT and CloudSearch that are often key points in a mobile project. Serverless aims to support these capabilities with a polyfill approach: fake Cloudformation-like configurations are created from resource configuration JSON, then they are translated to classes using AWS SDK to implement this capability.

We hope in the near future, as soon as Amity and Serverless both becomes mature that the projects could merge. Due to this reason we choose to keep amity project structure as cloose as possible to Serverless configuration files, in order to ease the process.

Now and in the future, our gratitude goes to Austen (@ac360) and the Serverless team for having deeply inspired us with his work.

X = just plain Javascript with AWS SDK for NodeJS

AWS SDK is great to be used as a library in your Node projects. Amity aims being something different and more structured, allowing developers to manage Projects directly from a single place. Using directly the SDK so remains a goog option, but is definitely too difficult to manage projects from it, enforcing some standard and best practices.

X = just plain GulpJS or LambdaAWS

GulpJS is a great tool for buld automation and could be easily adapted to manage Lambda funcitons packagind and deployment. Using it as a tool to create a cloud infrastructure, provision access policies (many of them coming from template evaluation) and keep the complete project under the same project is very hard to achieve. Moreover, it does not have an easy method to support functions plugging in and multi-region deployment. We started using just gulpJS, but quickly realized that the effort needed to make it work for other than build automation was more than starting a new project from scratch and using many gulp plugin in it. So we did amity. LambdaAWS was an interesting effort towards many of the feature we love in Amity, but was abandoned as soon as Lambda come out of 1.0.

X = Backbeam

Backbeam is an interesting tool, to manage infrastructure as code but has a strong vendor lock-in and it is not free. We aim providing Amity as an helpful tool any developer can use and evolve for her needs, thus making the overall system better at each iteration.

Contributing Amity

Since today Amity is backed only by Neosperience and all the development effort is due to Neosperience team (manu thanks to them) and to aletheia overnight effort, we're looking for contributors willing to join us into this fantastic project. Fork the project and start sending your pull requests!!

Amity sponsors

Amity is mantained and developed by

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago