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.06k stars 854 forks source link

Empty Serverless Application fresh template will not publish #726

Closed 13neno closed 6 years ago

13neno commented 7 years ago

I am trying to publish an out of the box AWS Serverless Application project, choosing the Empty Blueprint.

Expected Behavior

I expect the Serverless Application to be uploaded successfully - the Lambda Function to be created and visible in the console as well as being able to complete a simple test to hit the function.

Current Behavior

  1. Right click the project
  2. Click Publish to AWS Lambda...
  3. Chose my account profile to use => region: (Asia Pacific (Sydney))
  4. Configuration: Release => Framework: netcoreapp1.0
  5. Stack Name: "RandomName" => S3 Bucket - "MyS3BucketWhichIveCreated"
  6. Click Publish
  7. While publishing I receive this error: "Error creating CloudFormation change set: Parameter values specified for a template which does not require them."

Context

I am just trying to test this relatively new technology to see if it is a viable option for our organization.

Your Environment

Everything is from the template and I have not touched a thing in the solution. Any help is much appreciated!

wizofaus commented 7 years ago

Just got the same. But turned out it was just because I'd entered the name of an existing stack. Put a new one in and all good.

normj commented 7 years ago

In the aws-lambda-tools-defaults.json file in the project is there anything set for the template-parameters property? If so clear it out. I'm wondering if we have a validation issue with parameters being set in that file and we aren't making sure the parameter are valid for the current template.

n8allan commented 6 years ago

Just got this error. This is the appropriate excerpt from aws-lambda-tools-defaults.json: "template-parameters": ""

Removing that entry doesn't solve the issue.

normj commented 6 years ago

@n8allan What version of the toolkit are you running? Is this your first deployment of the application or are you redeploying to an existing stack?

VascoArreaza commented 6 years ago

I have the same problem and I am deploy for the first time that stack

n8allan commented 6 years ago

AWS Toolkit for Visual Studio 2017 - 1.14.0.1

The error must be wrong; I was able to get it to work by typing in a new stack name rather than selecting an existing one as suggested by wizofaus in this thread, Once the stack is created by the first deployment, subsequent deployments work correctly.

normj commented 6 years ago

@n8allan Interesting, did the existing stack have any parameters?

n8allan commented 6 years ago

No, it didn't. This was the out of the box project template resulting from the Visual Studio new project wizard. I suspect you can reproduce this by:

  1. creating a new project using the AWS Serverless Application template from the AWS VS SDK.
  2. attempt to deploy said application, selecting an already existing stack.

It may be that deploying into an existing stack isn't supported, but at the very least the error should be improved so as not to cause frustration and/or confusion. Thanks!

normj commented 6 years ago

Deploying into an existing stack is definitely supported and is a common scenario which is why I'm puzzled you are getting this error. So to be clear your repro steps are

1) Create a severless project, (Empty Serverless Application blueprint?) 2) Make no changes to the serverless.template and deploy the application 3) After deploying the application attempt to redeploy. And again you didn't make any changes to serverless.template?

Then you get the error message "Error creating CloudFormation change set: Parameter values specified for a template which does not require them."?

n8allan commented 6 years ago
  1. yes, Empty... blueprint
  2. correct, with a new S3 bucket, but choosing an existing stack. This is where the error occurs: "Found existing stack: True Error creating CloudFormation change set: Parameter values specified for a template which does not require them."
  3. No, if you create a new stack and deploy successfully, redeploy works fine.
n8allan commented 6 years ago

Here's an additional tidbit: if the stack I choose is a stack I've used in deploying another serverless app, it doesn't error. The stack that causes trouble in my case is an elastic beanstock stack. Again, if I choose a stack that was already used previously to deploy a serverless application, it works without error.

normj commented 6 years ago

Closing as this should be fixed with the tooling that was released as part of .NET Core 2.0. Also converting a CloudFormation stack from a beanstalk deployment to something completely different seems like a strange use case because it would tear down all of the beanstalk resources. Why wouldn't you just deploy to a new stack.