Git Product home page Git Product logo

serverless-rules's Introduction

Serverless Rules

The Serverless Rules are a compilation of rules to validate infrastructure as code template against recommended practices. This currently provides a module for cfn-lint and a plugin for tflint.

You can use those rules to get quick feedback on recommended practices while building a serverless application, as part of automated code review process, or as guardrails before deploying to production.

📜Documentation | 🐍PyPi

PUBLIC PREVIEW: this project is currently in public preview to get feedback from the serverless community. APIs, tools, and rules might change between the beginning of public preview and version 1.

You can find a list of currently supported rules in the documentation.

Usage guide

cfn-lint

To get started with Serverless Rules and cfn-lint, install cfn-lint-serverless module: pip install cfn-lint cfn-lint-serverless

You can now instruct cfn-lint to use Serverless Rules module installed previously via --append-rules or -a for short:

cfn-lint my_template.yaml -a cfn_lint_serverless.rules

You can try with a Serverless Application Model (SAM) example provided in this repository by running:

cfn-lint examples/sam/template.yaml -a cfn_lint_serverless.rules

tflint

This plugin depends on tflint. If you use tflint version 0.29 or newer, you can leverage the tflint --init command to automatically install the plugin. Otherwise, you will need to download the tflint-ruleset-aws-serverless binary corresponding to your system from the releases page.

You can enable the Serverless Rules plugin by adding a plugin section in the .tflint.hcl file in your project:

plugin "aws-serverless" {
  enabled = true
  version = "0.3.2"
  source = "github.com/awslabs/serverless-rules"
}

Contributing

See CONTRIBUTING to learn how to contribute to this project.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

serverless-rules's People

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.