CloudFormationValidatePlugin
- class aws_cdk.CloudFormationValidatePlugin(*, guard_rules=None, include_default_rules=None, rego_rules=None)
Bases:
objectValidation plugin that uses the CloudFormation validation engine to evaluate templates against built-in rules.
- ExampleMetadata:
fixture=validation-plugin infused
Example:
from aws_cdk import ValidationRuleSource # Rules text, read from disk perhaps # my_rules: str app = App() Validations.of(app).add_plugins(CloudFormationValidatePlugin( guard_rules=[ValidationRuleSource( name="My rules", content=my_rules )] ))
- Parameters:
guard_rules (
Optional[Sequence[Union[ValidationRuleSource,Dict[str,Any]]]]) – Custom Guard rules to evaluate in addition to built-in rules. Default: - no guard rulesinclude_default_rules (
Optional[bool]) – Whether to evaluate the default Rego rules that ship with the CDK. Registering aCloudFormationValidatePluginexplicitly replaces the auto-registered default instance, so without this flag adding custom rules would silently drop the CDK default rules. Individual default rules can be suppressed by ID viaValidations.of(scope).acknowledge(). Default: truerego_rules (
Optional[Sequence[Union[ValidationRuleSource,Dict[str,Any]]]]) – Custom Rego rules to evaluate in addition to built-in rules. Default: - no custom rules
Methods
- validate(context)
The method that will be called by the CDK framework to perform validations.
This is where the plugin will evaluate the CloudFormation templates for compliance and report and violations
- Parameters:
context (
IPolicyValidationContext)- Return type:
Attributes
- PLUGIN_NAME = 'CloudFormation Validate'
- name
The name of the plugin that will be displayed in the validation report.
- rule_ids
The list of rule IDs that the plugin will evaluate.
Used for analytics purposes.
- version
//semver.org/). This version is used for analytics purposes, to measure the usage of different plugins and different versions. The value of this property should be kept in sync with the actual version of the software package. If the version is not provided or is not a valid semantic version, it will be reported as
0.0.0.- Type:
The version of the plugin, following the Semantic Versioning specification (see https