aws-cloudformation / cfn-lint

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

AWS CloudFormation Incorrect Tag Validation for AWS::Serverless::HttpApi Resources in cfn-lint 1.4.0 #3436

Closed aashishshrestha09 closed 5 days ago

aashishshrestha09 commented 5 days ago

CloudFormation Lint Version

1.4.0

What operating system are you using?

Mac

Describe the bug

When using cfn-lint version 1.4.0 to validate a CloudFormation template (template.yml) that includes tags for an AWS::Serverless::HttpApi resource, an error (E3012) is encountered. This error persists even when the tags are provided in what should be a valid format according to AWS CloudFormation specifications.

Error Message: The error message (E3012) suggests that cfn-lint is not accepting the provided tag format, even though it conforms to AWS CloudFormation's requirements.

E3012 {'Environment': 'Production', 'httpapi:createdBy': 'SAM'} is not of type 'array'

Reproduction template

---
AWSTemplateFormatVersion: '2010-09-09'
Resources:
  MyHttpApi:
    Type: AWS::Serverless::HttpApi
    Properties:
      StageName: Prod
      Tags:
        Environment: Production
kddejong commented 5 days ago

translated

"MyHttpApiProdStage": {
   "Properties": {
    "ApiId": {
     "Ref": "MyHttpApi"
    },
    "AutoDeploy": true,
    "StageName": "Prod",
    "Tags": {
     "Environment": "Production",
     "httpapi:createdBy": "SAM"
    }
   },
   "Type": "AWS::ApiGatewayV2::Stage"
  }
kddejong commented 5 days ago

Similar to #3434. Working on a fix.