All Projects → Neosperience → GrassFormation

Neosperience / GrassFormation

Licence: MIT license
Deploy AWS Greengrass resources from your CloudFormation stack

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to GrassFormation

Reactnativeauth
Mobile user authentication flow with React Native, Expo, and AWS Amplify: Sign In, Sign Up, Confirm Sign Up, Forget Password, Reset Password.
Stars: ✭ 108 (+500%)
Mutual labels:  aws-cloudformation
Aws Cf Templates
A cloudonaut.io project. Engineered by widdix.
Stars: ✭ 2,399 (+13227.78%)
Mutual labels:  aws-cloudformation
cloudformation-resource-schema
The CloudFormation Resource Schema defines the shape and semantic for resources provisioned by CloudFormation. It is used by provider developers using the CloudFormation RPDK.
Stars: ✭ 77 (+327.78%)
Mutual labels:  aws-cloudformation
Cloudformation
Some CF templates
Stars: ✭ 123 (+583.33%)
Mutual labels:  aws-cloudformation
Aws Iam Generator
Generate Multi-Account IAM users/groups/roles/policies from a simple YAML configuration file and Jinja2 templates.
Stars: ✭ 191 (+961.11%)
Mutual labels:  aws-cloudformation
Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: ✭ 228 (+1166.67%)
Mutual labels:  aws-cloudformation
Brain Power Amazon Fidgetology
Serverless web app for streaming browser webcam feed to Amazon Kinesis Video Streams and Rekognition Video. See our post on the AWS Machine Learning Blog: https://aws.amazon.com/blogs/machine-learning/building-automatic-analysis-of-body-language-to-gauge-attention-and-engagement-using-amazon-kinesis-video-streams-and-amazon-ai-services
Stars: ✭ 84 (+366.67%)
Mutual labels:  aws-cloudformation
serverless-discord-bot
A serverless Discord Bot template built for AWS Lambda based on Discord's slash commands and the slash-create library.
Stars: ✭ 37 (+105.56%)
Mutual labels:  aws-cloudformation
Learn Cloudformation
Learn how to use Infrastructure as Code on AWS with the help of CloudFormation.
Stars: ✭ 191 (+961.11%)
Mutual labels:  aws-cloudformation
MPContribs
Platform for materials scientists to contribute and disseminate their materials data through Materials Project
Stars: ✭ 30 (+66.67%)
Mutual labels:  aws-cloudformation
Cfn Secret Provider
A CloudFormation custom resource provider for deploying secrets and keys
Stars: ✭ 125 (+594.44%)
Mutual labels:  aws-cloudformation
Cloudformation Cli
The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Stars: ✭ 149 (+727.78%)
Mutual labels:  aws-cloudformation
Deeplearning Cfn
Distributed Deep Learning on AWS Using CloudFormation (CFN), MXNet and TensorFlow
Stars: ✭ 252 (+1300%)
Mutual labels:  aws-cloudformation
Cfn Python Lint
CloudFormation Linter
Stars: ✭ 1,770 (+9733.33%)
Mutual labels:  aws-cloudformation
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 (+238.89%)
Mutual labels:  aws-cloudformation
Ask Cli
Alexa Skills Kit Command Line Interface
Stars: ✭ 100 (+455.56%)
Mutual labels:  aws-cloudformation
Docs
Rapid CloudFormation: Modular, production ready, open source.
Stars: ✭ 209 (+1061.11%)
Mutual labels:  aws-cloudformation
aws-cloudformation-resource-providers-codeartifact
The CloudFormation Resource Provider Package for the AWS CodeArtifact service
Stars: ✭ 26 (+44.44%)
Mutual labels:  aws-cloudformation
ecs composex
Manage, Configure and Deploy your services and AWS services and applications from your docker-compose definitions
Stars: ✭ 79 (+338.89%)
Mutual labels:  aws-cloudformation
stackup
a simple CLI and Ruby API for AWS CloudFormation
Stars: ✭ 89 (+394.44%)
Mutual labels:  aws-cloudformation

GrassFormation

Update: As of March 15, 2019 AWS CloudFormation natively supports Greengrass resources so it is highly recommended to use their official implementation.

GrassFormation is a collection of serverless functions that you can install on your Amazon Web Services (AWS) account. They enable you to easily provision AWS IoT, specifically Greengrass resources on your account in a reproducible, controlled way.

Greengrass is a software solution of AWS that allows you to remotely provision software code and device configuration on IoT devices. At the time there are three ways to use Greengrass: from the AWS Management Console, programmatically from one of the AWS SDKs or by using AWS Command Line Interface (CLI). The first method works well for prototyping but does not allow you to create a reliable, reproducible, production ready deployment pipeline. The second and the third method are extremely tedious and error prone considering the complexity of the Greengrass data model. The standard way to create cloud infrastructure in a reproducible, testable and automatic way on AWS infrastructure is to use CloudFormation templates. Unfortunately at the time there is no support for Greengrass resources in CloudFormation. GrassFormation aims to remedy this shortcoming.

GrassFormation is a collection of AWS lambda functions and a CloudFormation transform macro that allows you to deploy resources with CloudFormation that are otherwise not supported. After installing GrassFormation you can provision for example a Greengrass Group together with your other resources from a CloudFormation template as simple as:

AWSTemplateFormatVersion: '2010-09-09'

# Add GrassFormation to the transform section of your template:
Transform: ['AWS::Serverless-2016-10-31', 'GrassFormation']

GreengrassGroup:
  # GrassFormation defines new template types:
  Type: NSP::GrassFormation::Group
  Properties:
    Name: !Ref GroupNameParameter
    # Refer to other resources required by the Group in the standard CF way:
    GroupRoleArn: !GetAtt GreengrassGroupRole.Arn
    CoreDefinitionVersionArn: !GetAtt CoreDefinition.LatestVersionArn
    ResourceDefinitionVersionArn: !GetAtt ResourceDefinition.LatestVersionArn
    LoggerDefinitionVersionArn: !GetAtt LoggerDefinition.LatestVersionArn
    SubscriptionDefinitionVersionArn: !GetAtt SubscriptionDefinition.LatestVersionArn
    FunctionDefinitionVersionArn: !GetAtt FunctionDefinition.LatestVersionArn

For more examples see the examples folder.

Installing

Prerequisites

You will need an AWS Account.

Automatic installation

A packaged CloudFormation template is provided for you for easy, on-click installation of GrassFormation. This is the recommended method. This template will install some lambda functions to handle Greengrass resources creation requests, and the macro definition to easily integrate the resources into your stack. When you are ready, click on the button bellow:

Install GrassFormation to your AWS account

On the CloudFormation Management Console click three times "Next", acknowledge the creation of the IAM role (they are the lambda function execution roles) and finally "Create". When the stack finished the deployment you can start writing CloudFormation stacks that deploy Greengrass resources.

This template installs exclusively pay per use lambda resources on your account. AWS provides a generous free tier and generally low cost for lambda functions.

Manual installation

Use this method if you're familiar with Serverless Application Model and want to have full control over the installation.

This project supports Serverless Application Model. To deploy the CloudFormation custom resource handler lambda functions and the transform macro to your AWS infrastructure you should have:

  • An AWS account with an IAM user that has administrator permissions.
  • The AWS CLI (command line interface) installed.
  • To be able to use the local testing functionalities, also AWS SAM CLI installed.

A Makefile is provided for your convenience. To deploy the stack with make you should pass an s3 bucket name where the packaged SAM application will be deployed and optionally set the AWS region of the deployment (defaults to us-east-1). These variables can be also set as shell environment variables.

$ make deploy SAM_S3_BUCKET=my-bucket AWS_DEFAULT_REGION=eu-west-1

Now you can start writing CloudFormation stacks that deploy Greengrass resources. Examples are provided in the examples folder.

Usage

After installing this stack on your account you can start creating Greengrass resources in your CloudFormation template. First you should define the GrassFormation transform in your template:

AWSTemplateFormatVersion: '2010-09-09'
Transform: GrassFormation

Now you can start using the following new resource types:

  • NSP::GrassFormation::Group
  • NSP::GrassFormation::Core
  • NSP::GrassFormation::Function
  • NSP::GrassFormation::Resource
  • NSP::GrassFormation::Subscription
  • NSP::GrassFormation::Device
  • NSP::GrassFormation::Logger

All custom resource handler lambdas pass most of their attributes to the appropriate AWS Greengrass API However all functions abstract away the concept of "resource definition version" of Greengrass. Whenever you update your CloudFormation stack with GreenFormation, a new version of the updated entity will be automatically created. The attributes of the main entity (currently only Name for both entities) and those ones of the appropriate version entity are merged. Bearing this in mind you can find a list of the supported attributes below.

NSP::GrassFormation::Group

Supported attributes:

  • Name (string): The name of the Greengrass Group
  • GroupRoleArn (string): The ARN of the IAM Role to be associated with the Group. Your AWS Greengrass core will use the role to access AWS cloud services. The role's permissions should allow Greengrass core Lambda functions to perform actions against the cloud. The ARN specified in this attribute will be passed to the AssociateRoleToGroup API.
  • CoreDefinitionVersionArn, DeviceDefinitionVersionArn, FunctionDefinitionVersionArn, SubscriptionDefinitionVersionArn, LoggerDefinitionVersionArn, ResourceDefinitionVersionArn: see CreateGroupVersion API for more info.

NSP::GrassFormation::Core

Supported attributes:

NSP::GrassFormation::Function

Supported attributes:

NSP::GrassFormation::Resource

Supported attributes:

NSP::GrassFormation::Subscription

Supported attributes:

NSP::GrassFormation::Device

Supported attributes:

NSP::GrassFormation::Logger

Supported attributes:

Returned values

Similarly to Supported Parameters, the custom resource lambda functions return pretty much whatever the appropriate AWS API returns. For all Greengrass resources managed by GrassFormation the return value has the following schema:

  • Name : string. The name of the resource definition.
  • Id: string. The ID of the resource definition.
  • Arn: string. The ARN of the resource definition.
  • LatestVersion: string. The ID of the latest version of resourource definition.
  • LatestVersionArn: string. The ARN of the latest version of resourource definition.

You can find an example how to use them in the GreengrassGroup resource definition in the sample stack:

CoreDefinitionVersionArn: !GetAtt CoreDefinition.LatestVersionArn

Authors

Created by @jtolgyesi at Neosperience.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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].