Skip to content

--override-spec not adding custom resource types #3889

Open
@manueljimenezs

Description

@manueljimenezs

CloudFormation Lint Version

1.22.2

What operating system are you using?

Mac

Describe the bug

I'm trying to upgrade from cfn-lint 0.87.x to 1.x

For adding compatibility with custom macro resources I'm trying to provide custom specs for rules like E3006 via the --override-spec command. This is really useful as we use custom resources via macro and we currently integrate cfn-lint 0.x with our CI pipelines successfully as of today.

Here's a simple spec file for cfn-lint to recognize a custom OK::StandaloneTask resource, following the same syntax as StatefulResources.json. The docs say that specs should merge with the region-specific ones.

{
    "ResourceTypes": {
        "OK::StandaloneTask": {
            "Properties": {
              "ServiceName": {
                "Required": true,
                "PrimitiveType": "String"
              }
            }
          }
    }
}

In cfn-lint 0.87.11 the spec file was read and no errors were given, the template was successfully validated:

$ cfn-lint customresources.yaml --override-spec customspec.json && echo "$?"
0

However, in cfn-lint 1.22.2 the same command gives the following error

$ cfn-lint customresources.yaml --override-spec customspec.json
E3006 Resource type 'OK::StandaloneTask' does not exist in 'us-east-1'
customresources.yaml:9:5

This leads me to think there is a syntax change in spec definitions between 0.x and 1.x versions that I am not aware of?

Expected behavior

When passing an overriden spec, those specs should be used by cfn-lint.

Reproduction template

AWSTemplateFormatVersion: 2010-09-09
Description: mydescription

Transform: OKMacros

Resources:

  MyStandaloneTask:
    Type: OK::StandaloneTask
    Properties:
      ServiceName: "mystandalonetask"

Spec file:

{
    "ResourceTypes": {
        "OK::StandaloneTask": {
            "Properties": {
              "ServiceName": {
                "Required": true,
                "PrimitiveType": "String"
              }
            }
          }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions