Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gspeare opened this issue Sep 13, 2024 · 0 comments
Labels
bug We can reproduce the issue and confirmed it is a bug.

Comments

@gspeare
Copy link

gspeare commented Sep 13, 2024

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
@gspeare gspeare added the bug We can reproduce the issue and confirmed it is a bug. label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant