PolicyViolation 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 policyViolation: cdk.PolicyViolation = {
description: 'description',
ruleName: 'ruleName',
violatingResources: [{
locations: ['locations'],
// the properties below are optional
constructPath: 'constructPath',
resourceLogicalId: 'resourceLogicalId',
templatePath: 'templatePath',
}],
// the properties below are optional
fix: 'fix',
ruleMetadata: {
ruleMetadataKey: 'ruleMetadata',
},
severity: 'severity',
};
Properties
The description of the violation.
How to fix the violation.
Default: no fix is provided
ruleMetadataoptional{ [key: string]: string }rule_metadataoptionaltyping.Mapping[str, str]ruleMetadataoptionalMap<String, String>RuleMetadataoptionalIDictionary<string, string>RuleMetadataoptional*map[string]*string#Additional metadata to include with the rule results.
Default: no rule metadata
This can be used to provide additional information that is plugin specific. The data provided here will be rendered as is.
The name of the rule.
severityoptionalstringseverityoptionalstrseverityoptionalStringSeverityoptionalstringSeverityoptional*string#The severity of the violation, only used for reporting purposes.
Default: no severity
This is useful for helping the user discriminate between warnings, errors, information, etc.
violatingResourcesPolicyViolatingResource[]violating_resourcestyping.List[PolicyViolatingResource]violatingResourcesList<PolicyViolatingResource>ViolatingResourcesPolicyViolatingResource[]ViolatingResources*[]PolicyViolatingResourcerequired#The resources violating this rule.