Skip to content

Instantly share code, notes, and snippets.

@9bic
Created October 4, 2017 05:17
Show Gist options
  • Save 9bic/27ff43b253c51f0a84f85d9c966eff97 to your computer and use it in GitHub Desktop.
Save 9bic/27ff43b253c51f0a84f85d9c966eff97 to your computer and use it in GitHub Desktop.
Deploy netcore to AWS Lambda

How to deploy ASP.NET Core Application for AWS Lambda + API Gateway

Setup and run locally

  1. dotnet new -i Amazon.Lambda.Templates::* (for the first time only)
  2. dotnet new lambda.AspNetCoreWebAPI --name MyFirstApi --profile default --region ap-northeast-1
  3. cd MyFirstApi/src/MyFirstApi
  4. code . or Open Code -> Cmd + O -> Cmd + Shift + G -> input your working directory
  5. add launch.json/tasks.json
    • add configuration -> .NET Core
    • created .vscode/launch.json, and modifiy configurations[].program
    • "${workspaceRoot}/bin/Debug/<insert-target-framework-here>/<insert-project-name-here>.dll" -> "${workspaceRoot}/bin/Debug/netcoreapp1.0/MyFirstApi.dll"
    • remove .NET Core Launch (console) config(optionally)
    • run debug .NET Core Launch (web), maybe happend an error. and press configuration task runner -> .NET Core, created .vscode/tasks.json
  6. this project made be able to run locally, if you want to localtest, you try same procedure.

deploy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment