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.139.0 (build 26a6b54)",
               date="2026-07-30T08:06:26.718Z")
    @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 Detail

      • 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.

        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.

      • 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