Interface PolicyViolationJson

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
SuppressedViolationJson
All Known Implementing Classes:
PolicyViolationJson.Jsii$Proxy, SuppressedViolationJson.Jsii$Proxy

@Generated(value="jsii-pacmak/1.133.0 (build 0f43e37)", date="2026-07-02T13:32:49.626Z") @Stability(Stable) public interface PolicyViolationJson extends software.amazon.jsii.JsiiSerializable
A single policy violation found by a validation plugin.

Example:

 import software.amazon.awscdk.cloudassembly.schema.PolicyViolationJson;
 PolicyViolationJson violation = PolicyViolationJson.builder()
         .ruleName("no-public-access")
         .description("S3 bucket should not allow public access")
         .severity("error")
         .violatingConstructs(List.of(ViolatingConstructJson.builder().constructPath("MyStack/MyBucket").build()))
         .build();
 
  • Method Details

    • getDescription

      @Stability(Stable) @NotNull String getDescription()
      A description of the violation.
    • getRuleName

      @Stability(Stable) @NotNull String getRuleName()
      The name of the rule that was violated.
    • getSeverity

      @Stability(Stable) @NotNull String getSeverity()
      The severity of the violation.
    • getViolatingConstructs

      @Stability(Stable) @NotNull List<ViolatingConstructJson> getViolatingConstructs()
      Constructs that violated the rule.
    • getCustomSeverity

      @Stability(Stable) @Nullable default String getCustomSeverity()
      If the plugin wants to report using a non-standard severity, put it here.
    • getRuleMetadata

      @Stability(Stable) @Nullable default Map<String,String> getRuleMetadata()
      Additional rule-specific metadata.

      Default: - no metadata

    • getSuggestedFix

      @Stability(Stable) @Nullable default String getSuggestedFix()
      How to fix the violation.

      Default: - no fix provided

    • builder

      @Stability(Stable) static PolicyViolationJson.Builder builder()
      Returns:
      a PolicyViolationJson.Builder of PolicyViolationJson