Interface PolicyViolatingResource

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
PolicyViolatingResource.Jsii$Proxy

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-09-25T13:53:42.435Z") @Stability(Stable) public interface PolicyViolatingResource extends software.amazon.jsii.JsiiSerializable
Resource violating a specific rule.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 PolicyViolatingResource policyViolatingResource = PolicyViolatingResource.builder()
         .locations(List.of("locations"))
         // the properties below are optional
         .constructPath("constructPath")
         .resourceLogicalId("resourceLogicalId")
         .templatePath("templatePath")
         .build();
 
  • Method Details

    • getLocations

      @Stability(Stable) @NotNull List<String> getLocations()
      The locations in the CloudFormation template that pose the violations.

      This is a location in the CloudFormation template, relative to the resource that this violation is about. For example, if the violation is about a property of a resource, this will contain something like Properties.MyProperty. If the violation is about the Stack itself, it will contain something like Parameters.MyParameter.

    • getConstructPath

      @Stability(Stable) @Nullable default String getConstructPath()
      The construct path of the violating construct.

      Use this for violations that originate from constructs rather than CloudFormation resources (e.g. annotations added via Annotations.of() or Validations.of()). When provided, the report will use this path directly instead of deriving it from the resource logical ID. Mutually exclusive with resourceLogicalId.

      Default: - construct path is derived from the resource logical ID

    • getResourceLogicalId

      @Stability(Stable) @Nullable default String getResourceLogicalId()
      The logical ID of the resource in the CloudFormation template.

      Intended for plugin-sourced violations that operate on CloudFormation templates.

      If set, the constructPath will be added later.

      Default: - no resource logical ID

    • getTemplatePath

      @Stability(Stable) @Nullable default String getTemplatePath()
      The path to the CloudFormation template that contains this resource.

      Default: - no template path

    • builder

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