PolicyViolationBeta1

class aws_cdk.PolicyViolationBeta1(*, description, rule_name, violating_resources, fix=None, rule_metadata=None, severity=None)

Bases: object

Violation produced by the validation plugin.

Parameters:
  • description (str) – The description of the violation.

  • rule_name (str) – The name of the rule.

  • violating_resources (Sequence[Union[PolicyViolatingResourceBeta1, Dict[str, Any]]]) – The resources violating this rule.

  • fix (Optional[str]) – How to fix the violation. Default: - no fix is provided

  • rule_metadata (Optional[Mapping[str, str]]) – Additional metadata to include with the rule results. This can be used to provide additional information that is plugin specific. The data provided here will be rendered as is. Default: - no rule metadata

  • severity (Optional[str]) – The severity of the violation, only used for reporting purposes. This is useful for helping the user discriminate between warnings, errors, information, etc. Default: - no severity

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

policy_violation_beta1 = cdk.PolicyViolationBeta1(
    description="description",
    rule_name="ruleName",
    violating_resources=[cdk.PolicyViolatingResourceBeta1(
        locations=["locations"],
        resource_logical_id="resourceLogicalId",
        template_path="templatePath"
    )],

    # the properties below are optional
    fix="fix",
    rule_metadata={
        "rule_metadata_key": "ruleMetadata"
    },
    severity="severity"
)

Attributes

description

The description of the violation.

fix

How to fix the violation.

Default:
  • no fix is provided

rule_metadata

Additional metadata to include with the rule results.

This can be used to provide additional information that is plugin specific. The data provided here will be rendered as is.

Default:
  • no rule metadata

rule_name

The name of the rule.

severity

The severity of the violation, only used for reporting purposes.

This is useful for helping the user discriminate between warnings, errors, information, etc.

Default:
  • no severity

violating_resources

The resources violating this rule.