0

Im reading this doc: https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/lambda-build-test-severless-app.html

I created a serverless app using the "Blog API using DynamoDB" template.

When I publish from VS it deploys it to aws as a serverless app, but what commands is it running? How can I publish it from the command line (without VS)?

When I look at the serverless.template file the project comes with I just see parameter and resource definitions for AWS::Serverless::Functions and the dynamodb table- where is the pointer/config that register this as a "Application" in the lambda console- and not just a bunch of functions?

red888
  • 27,709
  • 55
  • 204
  • 392

1 Answers1

1

It's using the Serverless Application Model (or SAM for short). It's an abstraction on top of standard Cloudformation templates - it allows you to declare serverless application resources in a more succinct way. It also comes with a CLI. My guess would be that's what's running behind the scenes.

You can try it by yourself. After installing the SAM CLI, run sam build, sam package and sam deploy. That should get you off the ground.

sam build --template serverless.template # --use-container if necessary, needs Docker
sam package --output-template-file packaged.yml --s3-bucket ARTIFACTS_BUCKET
sam deploy --template-file packaged.yml --stack-name my-serverless-app --capabilities CAPABILITY_IAM
Milan Cermak
  • 7,476
  • 3
  • 44
  • 59
  • the template says its running `dotnet lambda...`. Does that compile and then run `sam build`? Id like to run these steps separately- first compile, run tests, then build, package deploy from command line – red888 Feb 27 '19 at 21:50
  • Honestly, I don't use Visual Studio, so I don't know what `dotnet lambda` does, but it's probably something similar. You can use these three commands separately, from the command line, as you wish. – Milan Cermak Feb 27 '19 at 21:59