Skip to content

sam.schema.json - more than 50 properties not supported even though CF supports 200 #5588

Open
@gspeare

Description

@gspeare

Problem

template.yaml with > 50 properties gets a lint error "Object has more properties than limit of 50". As per aws/aws-sam-cli#3757 200 are now supported.

Steps to reproduce the issue

  1. Make template.yaml file as per below.
  2. Observe lint error.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
  sam-app

  Sample SAM Template for sam-app

Parameters:
  Parameter1:
    Type: String
  Parameter2:
    Type: String
  Parameter3:
    Type: String
  Parameter4:
    Type: String
  Parameter5:
    Type: String
  Parameter6:
    Type: String
  Parameter7:
    Type: String
  Parameter8:
    Type: String
  Parameter9:
    Type: String
  Parameter10:
    Type: String
  Parameter11:
    Type: String
  Parameter12:
    Type: String
  Parameter13:
    Type: String
  Parameter14:
    Type: String
  Parameter15:
    Type: String
  Parameter16:
    Type: String
  Parameter17:
    Type: String
  Parameter18:
    Type: String
  Parameter19:
    Type: String
  Parameter20:
    Type: String
  Parameter21:
    Type: String
  Parameter22:
    Type: String
  Parameter23:
    Type: String
  Parameter24:
    Type: String
  Parameter25:
    Type: String
  Parameter26:
    Type: String
  Parameter27:
    Type: String
  Parameter28:
    Type: String
  Parameter29:
    Type: String
  Parameter30:
    Type: String
  Parameter31:
    Type: String
  Parameter32:
    Type: String
  Parameter33:
    Type: String
  Parameter34:
    Type: String
  Parameter35:
    Type: String
  Parameter36:
    Type: String
  Parameter37:
    Type: String
  Parameter38:
    Type: String
  Parameter39:
    Type: String
  Parameter40:
    Type: String
  Parameter41:
    Type: String
  Parameter42:
    Type: String
  Parameter43:
    Type: String
  Parameter44:
    Type: String
  Parameter45:
    Type: String
  Parameter46:
    Type: String
  Parameter47:
    Type: String
  Parameter48:
    Type: String
  Parameter49:
    Type: String
  Parameter50:
    Type: String
  Parameter51:
    Type: String

# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
  Function:
    Timeout: 3

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
    Properties:
      CodeUri: hello_world/
      Handler: app.lambda_handler
      Runtime: python3.9
      Architectures:
        - x86_64
      Events:
        HelloWorld:
          Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
          Properties:
            Path: /hello
            Method: get

Outputs:
  # ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
  # Find out more about other implicit resources you can reference within SAM
  # https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
  HelloWorldApi:
    Description: "API Gateway endpoint URL for Prod stage for Hello World function"
    Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
  HelloWorldFunction:
    Description: "Hello World Lambda Function ARN"
    Value: !GetAtt HelloWorldFunction.Arn
  HelloWorldFunctionIamRole:
    Description: "Implicit IAM Role created for Hello World function"
    Value: !GetAtt HelloWorldFunctionRole.Arn

Expected behavior

No error reported. Ideally, a way to shut off this validation as it seems to cause no end of problems even though the template.yaml passes the actual build and deploy process.

System details (run AWS: About and/or Amazon Q: About)

  • OS: Windows 10
  • Visual Studio Code version: 1.93.1
  • AWS Toolkit version: 3.24.0
  • Amazon Q version: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    aws-documentsAWS-specific programming languages, DSLs, filetypes, LSP, JSON schemaaws-documents-sam-cfnLSP or JSON schema for CFN/SAM template yaml/json filesbugWe can reproduce the issue and confirmed it is a bug.lambdasam

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions