# CloudFormation - Resource Schema Guard Rail
![Apache 2.0 License](https://img.shields.io/github/license/aws-cloudformation/resource-schema-guard-rail)
[![Pull Request CI](https://github.com/aws-cloudformation/resource-schema-guard-rail/actions/workflows/pr-ci.yml/badge.svg?branch=main)](https://github.com/aws-cloudformation/resource-schema-guard-rail/actions/workflows/pr-ci.yml)
[![PyPI](https://img.shields.io/pypi/v/resource-schema-guard-rail?label=pypi)](https://badge.fury.io/py/resource-schema-guard-rail)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/resource-schema-guard-rail?label=python)](https://pypi.org/project/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](https://github.com/aws-cloudformation/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](CONTRIBUTING.md#security-issue-notifications) for more information.
#### Rule Development
Read [Guard Rail: Rule Development](docs/RULE_DEVELOPMENT.md) 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:
```bash
$ 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
```
**[List of Linting Rules](docs/BASIC_LINTING.md)**
#### 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:
```bash
$ guard-rail --schema file://path-to-schema-1 --schema file://path-to-schema-2 --rule ... --stateful
```
**[List of Breaking Change Rules](docs/BREAKING_CHANGE.md)**
*Additionally, you can specify `format` argument, which will produce a nicely formatted output.
### How to install it locally?
Use following commands
#### Clone github repo
```bash
$ 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:
[![Join our Discord](https://discordapp.com/api/guilds/981586120448020580/widget.png?style=banner3)](https://discord.gg/9zpd7TTRwq)
Raw data
{
"_id": null,
"home_page": null,
"name": "resource-schema-guard-rail",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Amazon Web Services",
"author_email": "aws-cloudformation-developers@amazon.com",
"download_url": "https://files.pythonhosted.org/packages/47/3f/11a1dcec048909b67525750bf1bac20bdacaf3b5ca71bf820b66e678a2ab/resource-schema-guard-rail-0.0.16.tar.gz",
"platform": null,
"description": "# CloudFormation - Resource Schema Guard Rail\n![Apache 2.0 License](https://img.shields.io/github/license/aws-cloudformation/resource-schema-guard-rail)\n[![Pull Request CI](https://github.com/aws-cloudformation/resource-schema-guard-rail/actions/workflows/pr-ci.yml/badge.svg?branch=main)](https://github.com/aws-cloudformation/resource-schema-guard-rail/actions/workflows/pr-ci.yml)\n[![PyPI](https://img.shields.io/pypi/v/resource-schema-guard-rail?label=pypi)](https://badge.fury.io/py/resource-schema-guard-rail)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/resource-schema-guard-rail?label=python)](https://pypi.org/project/resource-schema-guard-rail/)\n\n### Notes\nThis is not a stable version (Beta), it's still under development\n\n## Overview\nAWS CloudFormation Resource Schema Guard Rail is an open-source tool, which uses [CloudFormation Guard](https://github.com/aws-cloudformation/cloudformation-guard/) policy-as-code evaluation engine to assess resource schema compliance. It validates json resource schemas against the AWS CloudFormation modeling best practices.\n\n### Contribute\nSee [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.\n#### Rule Development\nRead [Guard Rail: Rule Development](docs/RULE_DEVELOPMENT.md) for more information on how to write resource schema rules.\n\n### How to use it?\nSchema 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;\n\n#### Basic Linter (Stateless)\nLinter 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.\n\nIn order to start using Basic Linting you need to run following command:\n```bash\n$ 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\n```\n\n**[List of Linting Rules](docs/BASIC_LINTING.md)**\n\n#### Breaking Change (Stateful)\nAlong 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.\n\nIn order to start using Basic Linting you need to run following command:\n```bash\n$ guard-rail --schema file://path-to-schema-1 --schema file://path-to-schema-2 --rule ... --stateful\n```\n\n**[List of Breaking Change Rules](docs/BREAKING_CHANGE.md)**\n\n\n*Additionally, you can specify `format` argument, which will produce a nicely formatted output.\n\n### How to install it locally?\n\nUse following commands\n\n#### Clone github repo\n```bash\n$ git clone git@github.com:aws-cloudformation/resource-schema-guard-rail.git\n```\n#### Create Virtual Environment & Activate\n```\npython3 -m venv env\nsource env/bin/activate\n```\n\n#### Install Package Locally from the root\n\n```\npip install -e . -r requirements.txt\npre-commit install\n```\n\n#### Run CI Locally\n\n```\n# run all hooks on all files, mirrors what the CI runs\npre-commit run --all-files\n```\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n\n## Community\n\nJoin us on Discord! Connect & interact with CloudFormation developers &\nexperts, find channels to discuss and get help for our CLI, cfn-lint, CloudFormation registry, StackSets,\nGuard and more:\n\n[![Join our Discord](https://discordapp.com/api/guilds/981586120448020580/widget.png?style=banner3)](https://discord.gg/9zpd7TTRwq)\n\n\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Schema Guard Rail",
"version": "0.0.16",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0f6d0c19ff896b4f84d49c42ba14122b7982b3fca07b28356bc2262288f788b4",
"md5": "ef64a877c118c82a062758987a9eea80",
"sha256": "46fef825137555edd41807839f6ae5905d97214e526eec719187f4dfb750c51a"
},
"downloads": -1,
"filename": "resource_schema_guard_rail-0.0.16-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ef64a877c118c82a062758987a9eea80",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 27968,
"upload_time": "2024-11-04T23:59:46",
"upload_time_iso_8601": "2024-11-04T23:59:46.048777Z",
"url": "https://files.pythonhosted.org/packages/0f/6d/0c19ff896b4f84d49c42ba14122b7982b3fca07b28356bc2262288f788b4/resource_schema_guard_rail-0.0.16-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "473f11a1dcec048909b67525750bf1bac20bdacaf3b5ca71bf820b66e678a2ab",
"md5": "271a6575ccf7eefa87afd79e90263835",
"sha256": "51ca7f1e9ac87de122c84b7def8b32cf638a8fe42d4f4c83bc6078978d1c5427"
},
"downloads": -1,
"filename": "resource-schema-guard-rail-0.0.16.tar.gz",
"has_sig": false,
"md5_digest": "271a6575ccf7eefa87afd79e90263835",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 22433,
"upload_time": "2024-11-04T23:59:47",
"upload_time_iso_8601": "2024-11-04T23:59:47.577446Z",
"url": "https://files.pythonhosted.org/packages/47/3f/11a1dcec048909b67525750bf1bac20bdacaf3b5ca71bf820b66e678a2ab/resource-schema-guard-rail-0.0.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-04 23:59:47",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "resource-schema-guard-rail"
}