CloudFormationValidatePluginProps
- class aws_cdk.CloudFormationValidatePluginProps(*, guard_rules=None, include_default_rules=None, rego_rules=None)
Bases:
objectProperties for configuring the CloudFormationValidatePlugin.
- 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
- 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 )] ))
Attributes
- guard_rules
Custom Guard rules to evaluate in addition to built-in rules.
- Default:
no guard rules
- include_default_rules
Whether to evaluate the default Rego rules that ship with the CDK.
Registering a
CloudFormationValidatePluginexplicitly 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:
true
- rego_rules
Custom Rego rules to evaluate in addition to built-in rules.
- Default:
no custom rules