aws / aws/aws-toolkit-vscode

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

Open
#5,588 0 comments 0 reactions 0 assignees View on GitHub
aws-documents aws-documents-sam-cfn bug lambda sam
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

## Problem
template.yaml with > 50 properties gets a lint error "Object has more properties than limit of 50". As per https://github.com/aws/aws-sam-cli/issues/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

Contributor guide

Open the contributing guide

Research direction

Start with sam.schema.json and reproduce the reported validation using the template.yaml example with more than 50 parameters. Confirm the schema limit is aligned with the stated CloudFormation support for 200 properties, then verify that the example no longer reports the limit error while validation still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cloud, tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.