PolicyViolationJson Struct
A single policy violation found by a validation plugin.
Example
ts
import { PolicyViolationJson } from '@aws-cdk/cloud-assembly-schema';
const violation: PolicyViolationJson = {
ruleName: 'no-public-access',
description: 'S3 bucket should not allow public access',
severity: 'error',
violatingConstructs: [{ constructPath: 'MyStack/MyBucket' }],
};
Properties
customSeverityoptionalstringcustom_severityoptionalstrcustomSeverityoptionalStringCustomSeverityoptionalstringCustomSeverityoptional*string#If the plugin wants to report using a non-standard severity, put it here.
A description of the violation.
ruleMetadataoptional{ [key: string]: string }rule_metadataoptionaltyping.Mapping[str, str]ruleMetadataoptionalMap<String, String>RuleMetadataoptionalIDictionary<string, string>RuleMetadataoptional*map[string]*string#Additional rule-specific metadata.
Default: no metadata
The name of the rule that was violated.
This may include a namespace: '<namespace>::<rule-name>'. If it does not, the plugin name will be used as the namespace.
The namespace must be included when acknowledging the violation.
The severity of the violation.
suggestedFixoptionalstringsuggested_fixoptionalstrsuggestedFixoptionalStringSuggestedFixoptionalstringSuggestedFixoptional*string#How to fix the violation.
Default: no fix provided
violatingConstructsViolatingConstructJson[]violating_constructstyping.List[ViolatingConstructJson]violatingConstructsList<ViolatingConstructJson>ViolatingConstructsViolatingConstructJson[]ViolatingConstructs*[]ViolatingConstructJsonrequired#Constructs that violated the rule.