aws-cloudformation / cfn-lint

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

Incorrect E3686 'AWS::RDS::DBCluster' ServerlessV2ScalingConfiguration exists if EngineMode is not set #3424

Closed sudoudaisuke closed 5 days ago

sudoudaisuke commented 5 days ago

CloudFormation Lint Version

1.3.7

What operating system are you using?

docker container based on python:3.12-alpine

Describe the bug

$ cfn-lint --template ./a.yaml
E3686 Additional properties are not allowed ('ServerlessV2ScalingConfiguration')
a.yaml:7:7

Expected behavior

Do not report that that ServerlessV2ScalingConfiguration is not allowed.

Default EngineMode property value is "provisioned". So, if EngineMode is not set then error fof ScalingConfiguration property exists, but not error for ServerlessV2ScalingConfiguration property exists.

https://github.com/aws-cloudformation/cfn-lint/blob/3b782cbecf3073ae96ea33e202e4e2a4f15e3a4d/src/cfnlint/data/schemas/extensions/aws_rds_dbcluster/serverless_exclusive.json#L50

Reproduction template

Resources:
  AuroraClustor:
    Type: AWS::RDS::DBCluster
    Properties:
      Engine: aurora-postgresql
      EngineVersion: 14.6
      ServerlessV2ScalingConfiguration:
        MaxCapacity: 1
        MinCapacity: 1
kddejong commented 5 days ago

If you have a chance look at the PR and provide your thoughts