aws / aws-sdk-net

The official AWS SDK for .NET. For more information on the AWS SDK for .NET, see our web site:
http://aws.amazon.com/sdkfornet/
Apache License 2.0
2.07k stars 862 forks source link

Valid CloudFormation template throws errors in Visual Studio #663

Closed mentormate-vassil-vassilev closed 7 years ago

mentormate-vassil-vassilev commented 7 years ago

A valid CloudFormation template generated online from the AWS Console Designer throws errors in Visual Studio 2017 - " key is invalid for this object" and " is an unknown attribute for this resource". Here is a screenshot: aws error

Thanks!

mentormate-vassil-vassilev commented 7 years ago

Same happening for the "FunctionName" key inside the "Properties" object of a "AWS::Serverless::Function" resource. Based on the AWS SAM model (https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction) it should be supported. I am using the same version - 2016-10-31.

normj commented 7 years ago

Thanks for letting us know. I see the missing FunctionName in our schema. Could you attach the actual template that shows the error you are seeing in the first casse?

mentormate-vassil-vassilev commented 7 years ago

Yes, I'll do. Here are some steps to reproduce:

  1. Open Visual Studio 2017 and create a new AWS Serverless Application based on the .NET Core Web API template (or any other)
  2. Copy the CloudFormation template from the image recognition reference app here - https://github.com/awslabs/lambda-refarch-imagerecognition/blob/master/cloudformation/image-processing.serverless.yaml
  3. Open the AWS Console online and go to the CF template designer - https://console.aws.amazon.com/cloudformation/designer/home
  4. Paste the template from step 2 in the Template tab
  5. Choose JSON as a template language to convert
  6. Copy the resulted JSON and paste it in the serverless.template file in VS from step 1
  7. You will see 21 errors

I'm attaching the template here (renaming to TXT). Let me know if there is anything else you need.

Do you have an ETA on this? It's blocking the work I am currently doing.

Thanks!

serverless.template.txt

normj commented 7 years ago

Thanks for the repo. We just released version 1.12.1.1 of the VS toolkit which contains some fixes that made it so I was able to load that template with no errors.

mentormate-vassil-vassilev commented 7 years ago

Now it works for me. Thanks!