Schema Guard Rail
Project description
CloudFormation - Resource Schema Guard Rail
Notes
This is not a stable version (Beta), it's still under development
Overview
AWS CloudFormation Resource Schema Guard Rail is an open-source tool, which uses CloudFormation Guard policy-as-code evaluation engine to assess resource schema compliance. It validates json resource schemas against the AWS CloudFormation modeling best practices.
Contribute
See CONTRIBUTING for more information.
Rule Development
Read Guard Rail: Rule Development for more information on how to write resource schema rules.
How to use it?
Schema guard rail package has a built-in library of rules, that CloudFormation believe are the best practices that resource modelers should follow. It supports two types of evaluation - Basic Linting & Breaking Change;
Basic Linter (Stateless)
Linter works only with current version of resource schema and runs CloudFormation authored rules, which will highlight problematic schema constructs. A provider developers can run multiple independent schemas at once as well as attach custom rules.
In order to start using Basic Linting you need to run following command:
$ guard-rail --schema file://path-to-schema-1 --schema file://path-to-schema-2 --rule file://path-to-custom-ruleset1 --rule file://path-to-custom-ruleset2
Breaking Change (Stateful)
Along with basic linting, guard rail supports capability of breaking change evaluation. Provider developer must provider two json objects - previous & current versions of the same resource schema. CloudFormation authored rules will be run and evaluation current version of the schema whether it is compliant or not.
In order to start using Basic Linting you need to run following command:
$ guard-rail --schema file://path-to-schema-1 --schema file://path-to-schema-2 --rule ... --stateful
*Additionally, you can specify format
argument, which will produce a nicely formatted output.
How to install it locally?
Use following commands
Clone github repo
$ git clone git@github.com:aws-cloudformation/resource-schema-guard-rail.git
Create Virtual Environment & Activate
python3 -m venv env
source env/bin/activate
Install Package Locally from the root
pip install -e . -r requirements.txt
pre-commit install
Run CI Locally
# run all hooks on all files, mirrors what the CI runs
pre-commit run --all-files
License
This project is licensed under the Apache-2.0 License.
Community
Join us on Discord! Connect & interact with CloudFormation developers & experts, find channels to discuss and get help for our CLI, cfn-lint, CloudFormation registry, StackSets, Guard and more:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file resource-schema-guard-rail-0.0.16.tar.gz
.
File metadata
- Download URL: resource-schema-guard-rail-0.0.16.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51ca7f1e9ac87de122c84b7def8b32cf638a8fe42d4f4c83bc6078978d1c5427 |
|
MD5 | 271a6575ccf7eefa87afd79e90263835 |
|
BLAKE2b-256 | 473f11a1dcec048909b67525750bf1bac20bdacaf3b5ca71bf820b66e678a2ab |
File details
Details for the file resource_schema_guard_rail-0.0.16-py3-none-any.whl
.
File metadata
- Download URL: resource_schema_guard_rail-0.0.16-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46fef825137555edd41807839f6ae5905d97214e526eec719187f4dfb750c51a |
|
MD5 | ef64a877c118c82a062758987a9eea80 |
|
BLAKE2b-256 | 0f6d0c19ff896b4f84d49c42ba14122b7982b3fca07b28356bc2262288f788b4 |