aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.43k stars 588 forks source link

cfn-lint v1 does not warn about missing mapping keys #3385

Closed nosnilmot closed 3 months ago

nosnilmot commented 3 months ago

CloudFormation Lint Version

1.3.3 & git (b0782f87c)

What operating system are you using?

Mac

Describe the bug

cfn-lint v1 (1.3.3) does not warn about missing mapping keys.

This was first noticed with missing second level key, but it applies to both first and second level.

Expected behavior

cfn-lint 0.87.7 would warn:

W1011 FindInMap second key "MissingName" doesn't exist in map "Map" under "Key" at Resources/Bucket/Properties/BucketName/Fn::FindInMap
map.yaml:14:11

I would actually expect this to be W7xxx or even E7xxx, but I'll be happy with anything other than silence 😄

Reproduction template

AWSTemplateFormatVersion: '2010-09-09'
Mappings:
  Map:
    Key:
      Name: "unused"
Resources:
  Bucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName:
        Fn::FindInMap:
        - "Map"
        - "Key"
        - "MissingName"
nosnilmot commented 3 months ago

Rule W1011 was removed in c7d01e9 (#3055) and is now used for a completely different warning (Use dynamic references over parameters for secrets)

kddejong commented 3 months ago

Looking into it. We should have still caught this but the rule would have changed so I have to see what I'm missing.