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

Cloudformation (Serverless Application Model - SAM) serverless.template in Visual Studio shows errors but builds and deploys #415

Open
dzeidman opened this issue Apr 14, 2024 · 1 comment
Labels
bug We can reproduce the issue and confirmed it is a bug.

Comments

@dzeidman
Copy link

Describe the bug
There are a number of errors shown when adding entries into a serveless.template json file. These entries are all valid according to the documentation and the template builds and deploys correctly but there are red squiggly error marks shown in the json file.

To Reproduce

There are a number of incorrect syntax errors. One such example is with the following resource:

"MySQLUserDBCluster": {
       "Type":"AWS::RDS::DBCluster",
       "Properties": {        
       "DBClusterIdentifier": "UserDBCluster",
       "MasterUsername": "atadmin",
       "MasterUserPassword": {
         "Ref": "MasterMySQLPassword"
       },
       "EngineVersion": "8.0",
       "Engine" : "aurora-mysql",
       "EngineMode" : "provisioned",
         "ServerlessV2ScalingConfiguration": {
           "MaxCapacity": 20,
           "MinCapacity": 1
         },         
       "VpcSecurityGroupIds": [
         {
           "Ref": "MySecurityGroup"
         }
       ]
     }
   },

the lines

"ServerlessV2ScalingConfiguration": {
           "MaxCapacity": 20,
           "MinCapacity": 1

are shown to be in error. When I hover over "ServerlessV2ScalingConfiguration" it says "ServerlessV2ScalingConfiguration key is invalid for this object"

The same goes for the reference to MySecurityGroup. Hovering over it, It says "MySecurityGroup is an invalid type for this reference". However, it is not and it works fine.

Expected behavior

I would expect the code to show correct syntax. The items should appear in the intellisence dropdowns and should resolve without a red squiggly line.

Development System (please complete the following information):

  • Windows Version: 11 Pro version 10.0.22631
  • Visual Studio Version: Professional 2022, version 17.9.5
  • AWS Toolkit for Visual Studio Version: 1.50.0.0

Additional context

This was first submitted on AWS re:Post here: https://repost.aws/questions/QUNhx2zUN1RN2ZNjhCQ1RH7A/cloudformation-serverless-application-model-sam-serverless-template-in-visual-studio-shows-errors-but-builds-and-deploys

@dzeidman dzeidman added the bug We can reproduce the issue and confirmed it is a bug. label Apr 14, 2024
@shruti0085
Copy link
Contributor

@dzeidman Thanks for bringing this issue to our attention. I was able to reproduce this issue and am investigating further

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

2 participants