@@ -125,20 +125,27 @@ data class RuleFilterConfig(
125125 val idRanges : List <IdRange > = emptyList(), // numeric ranges, e.g. IdRange("E", 3000, 3099)
126126 val idPatterns : List <String > = emptyList(), // regex patterns matched against rule IDs
127127 val resourceIds : List <ResourceIdFilter > = emptyList(), // a rule (or every rule) on a logical resource ID
128+ val logicalIds : List <LogicalIdFilter > = emptyList(), // a rule (or every rule) on a named template entity
128129 val resourceTypes : List <ResourceTypeFilter > = emptyList(), // a rule (or every rule) on a resource type
129130 val services : List <ServiceFilter > = emptyList(), // a rule (or every rule) on a service, e.g. "AWS::AutoScaling"
130131)
131132
132- // resourceIds / resourceTypes / services each carry a nullable ruleId:
133+ // resourceIds / logicalIds / resourceTypes / services each carry a nullable ruleId:
133134// set it to scope the filter to one rule, or leave it null for every rule on the target.
134135data class ResourceIdFilter (val ruleId : String? = null , val resourceId : String )
136+ data class LogicalIdFilter (val ruleId : String? = null , val logicalId : String , val entityType : EntityType ? = null )
135137data class ResourceTypeFilter (val ruleId : String? = null , val resourceType : String )
136138data class ServiceFilter (val ruleId : String? = null , val service : String )
137139```
138140
139141The ` service ` is matched verbatim against the ` service-provider::service-name ` prefix of the resource type — its first
140142two ` :: ` -delimited segments (e.g. ` AWS::AutoScaling ` in ` AWS::AutoScaling::LaunchConfiguration ` ).
141143
144+ The ` resourceIds ` dimension matches only diagnostics attributed to a resource; ` logicalIds ` additionally matches
145+ diagnostics on parameters, outputs, mappings, conditions, and template rules (for resource diagnostics the two carry
146+ the same value). A non-null ` entityType ` scopes a ` LogicalIdFilter ` to entities of one type, so ` MyThing ` as a
147+ ` PARAMETER ` is matched without touching a same-named entity of another type.
148+
142149### PseudoParameterOverrides
143150
144151Override CloudFormation pseudo-parameters used during intrinsic function resolution. All fields optional — when ` null ` ,
@@ -209,7 +216,7 @@ data class StandardReport(
209216```
210217
211218` DetailedReport ` has the same structure but its diagnostics include additional fields: ` documentationUrl ` ,
212- ` ruleDescription ` , ` phase ` (` PARSE ` | ` SCHEMA ` | ` LINT ` ), ` section ` , and ` context ` (` ViolationContext ` with
219+ ` ruleDescription ` , ` phase ` (` PARSE ` | ` SCHEMA ` | ` LINT ` ), and ` context ` (` ViolationContext ` with
213220` actualValue ` , ` expectedConstraint ` , ` resolutionSource ` , etc.).
214221
215222### StandardDiagnostic
@@ -220,9 +227,8 @@ data class StandardDiagnostic(
220227 val severity : Severity , // FATAL, ERROR, WARN, INFO, DEBUG
221228 val message : String ,
222229 val source : RuleOrigin , // SCHEMA, CFN_LINT, ENGINE, CUSTOM, GUARD
223- val resourceId : String? , // logical resource ID
224- val resourceType : String? , // e.g. "AWS::S3::Bucket"
225- val propertyPath : String? , // e.g. "Properties/BucketName"
230+ val entity : Entity ? , // the named template entity the finding targets, if any
231+ val propertyPath : String? , // e.g. "Properties.BucketName", or section-absolute like "Parameters/MyParam/Type"
226232 val suggestedFix : String? ,
227233 val category : String? ,
228234 val startLine : UInt? ,
@@ -232,4 +238,17 @@ data class StandardDiagnostic(
232238 val relatedResources : List <RelatedResource >? ,
233239 val conditionScenario : Map <String , Boolean >? , // condition truth assignment that triggers this
234240)
241+
242+ // The named template entity a diagnostic is attributed to. The entity type is the
243+ // singular form of the top-level template section the entity is declared in.
244+ data class Entity (
245+ val logicalId : String , // logical ID as declared in the template
246+ val entityType : EntityType ,
247+ val resourceType : String? = null , // CloudFormation type, when the entity is a resource whose type is known
248+ )
249+
250+ enum class EntityType {
251+ RESOURCE , PARAMETER , OUTPUT , MAPPING , METADATA ,
252+ RULE , CONDITION , TRANSFORM , FORMAT_VERSION , DESCRIPTION ,
253+ }
235254```
0 commit comments