aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.4k stars 577 forks source link

Incorrect E3002 'AWS::ImageBuilder::ContainerRecipe' BlockDeviceMappings property #3412

Closed sudoudaisuke closed 6 days ago

sudoudaisuke commented 6 days ago

CloudFormation Lint Version

1.3.5

What operating system are you using?

docker container based on python:3.12-alpine

Describe the bug

$ cfn-lint --template ./a.yaml
E3002 Additional properties are not allowed ('BlockDeviceMappings' was unexpected)
a.yaml:12:9

Expected behavior

no errors or warnings

Reproduction template

Resources: 
  AasOpenSearchDomainNginxProxyContainer:
    Type: AWS::ImageBuilder::ContainerRecipe
    Properties:
      Components: []
      ContainerType: DOCKER
      TargetRepository:
        RepositoryName: sampleRepository
      DockerfileTemplateData: |
        FROM {{{ imagebuilder:parentImage }}}
      InstanceConfiguration:
        BlockDeviceMappings:
          - DeviceName: /dev/xvda
            Ebs:
              DeleteOnTermination: true
      ParentImage: amazonlinux:2023
      Name: sampleName
      Version: 1.0.0
kddejong commented 6 days ago

This is tripping up the json schema validation as its expecting properties to be along the additionalProperties going to patch it out as it doesn't need to be there.

"InstanceConfiguration": {
   "$ref": "#/definitions/InstanceConfiguration",
   "additionalProperties": false
  },
kddejong commented 6 days ago

Fixed in #3413 release with v1.3.6