Skip to content
v2.273.0

PolicyViolationBeta1 Struct ​

Violation produced by the validation plugin.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const policyViolationBeta1: cdk.PolicyViolationBeta1 = {
  description: 'description',
  ruleName: 'ruleName',
  violatingResources: [{
    locations: ['locations'],
    resourceLogicalId: 'resourceLogicalId',
    templatePath: 'templatePath',
  }],

  // the properties below are optional
  fix: 'fix',
  ruleMetadata: {
    ruleMetadataKey: 'ruleMetadata',
  },
  severity: 'severity',
};

Properties ​

descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*stringrequired#
The description of the violation.
fixstringfixstrfixStringFixstringFix*string= no fix is provided#
How to fix the violation.
ruleMetadata{ [key: string]: string }rule_metadatatyping.Mapping[str, str]ruleMetadataMap<String, String>RuleMetadataIDictionary<string, string>RuleMetadata*map[string]*string= no 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.

ruleNamestringrule_namestrruleNameStringRuleNamestringRuleName*stringrequired#
The name of the rule.
severitystringseveritystrseverityStringSeveritystringSeverity*string= no severity#
The severity of the violation, only used for reporting purposes.

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

violatingResourcesPolicyViolatingResourceBeta1[]violating_resourcestyping.List[PolicyViolatingResourceBeta1]violatingResourcesList<PolicyViolatingResourceBeta1>ViolatingResourcesPolicyViolatingResourceBeta1[]ViolatingResources*[]PolicyViolatingResourceBeta1required#
The resources violating this rule.