GithubHelp home page GithubHelp logo

tchigher / aws-lambda-dotnet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws/aws-lambda-dotnet

0.0 0.0 0.0 20.71 MB

Libraries, samples and tools to help .NET Core developers develop AWS Lambda functions.

License: Apache License 2.0

C# 49.22% JavaScript 8.93% CSS 0.28% F# 3.35% PowerShell 35.31% Batchfile 0.03% HTML 2.89%

aws-lambda-dotnet's Introduction

AWS Lambda for .NET Core Gitter

Repository for the AWS NuGet packages and Blueprints to support writing AWS Lambda functions using .NET Core.

For a history of releases view the release change log

Version Status

Our intention is to keep a regular patch and update cycle to ensure Lambda developers have access to the currently supported patch of each major version of .NET Core. Given the development and deployment effort, our target is to have most rollouts complete in less than a month. We do not expect it to be less than one week. This enables us to ensure high quality deployments. We will give special attention to any versions that contain security updates critical to .NET Core in AWS Lambda.

The table below shows the currently supported patch of each major version of .NET Core in AWS Lambda, the next version(s) we plan on deploying, and the latest version released by Microsoft. These are subject to change and we'll keep this table as up-to-date as possible.

Version Currently Supported Patch In Development Queue Latest Microsoft Release
1.0 1.0.13 1.0.16 1.0.16
2.0 2.0.9 2.0.9
2.1 2.1.15 2.1.17
3.1 3.1.1 3.1.3

Learning Resources

Lambda Developer Guide

AWS Blog Posts

Community Posts

Templates & Repositories

  • serverlessDotNetStarter - By Florian Fuß
    • Start with a simple template for Visual Studio Code
    • Debug locally with Lambda NET Mock Test Tool
    • Deploy easily with the serverless framework

AWS Recorded Talks

  • Building a .NET Serverless Application on AWS By Abby Fuller, Tara Walker and Nicki Klien 2018
    • Demo of a serverless application using the AWS .NET SDK, AWS Lambda, AWS CodeBuild, AWS X-Ray, Amazon Dynamo DB Accelorator (DAX), and the AWS Toolkit for Visual Studio.
  • Serverless Applications with AWS - From NDC Minnesota 2018 by Norm Johanson
    • Description of how .NET Core Lambda works
    • Explain how AWS Lambda scales
    • How to use AWS Step Functions
    • A brief section on using the .NET Lambda tools for CI/CD
  • .NET Serverless Development on AWS - AWS Online Tech Talks by Norm Johanson 2018
    • Shows how to use both Visual Studio and dotnet CLI tools
    • Create an F# Lambda function
    • How to use X-Ray with Lambda
    • Demonstrate using the dotnet lambda package-ci command for CI/CD with AWS Code services.
  • Containers and Serverless with AWS - From NDC Oslo 2018 By Norm Johanson
    • Compares the serverless and container platforms to help inform deciding which platform to use.
  • How to Deploy .NET Code to AWS from Within Visual Studio - AWS Online Tech Talks, August 2017

Community Recorded Talks

NuGet Packages

Events

This packages in this folder contains classes that can be used as input types for Lambda functions that process various AWS events.

These are the packages and their README.md files:

Amazon.Lambda.Tools

Package adds commands to the dotnet cli that can be used manage Lambda functions including deploying a function from the dotnet cli. For more information see the README.md file for Amazon.Lambda.Tools.

Global Tool Migration

As of September 10th, 2018 Amazon.Lambda.Tools has migrated to be .NET Core Global Tools. As part of the migration the version number was set to 3.0.0.0

To install Amazon.Lambda.Tools use the dotnet tool install command.

dotnet tool install -g Amazon.Lambda.Tools

To update to the latest version of Amazon.Lambda.Tools use the dotnet tool update command.

dotnet tool update -g Amazon.Lambda.Tools
Migrating from DotNetCliToolReference

To migrate an existing project away from the older project tool, you need to edit your project file and remove the DotNetCliToolReference for the Amazon.Lambda.Tools package. For example, let's look at an existing Lambda project file.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

    <-- The new property indicating to AWS Toolkit for Visual Studio this is a Lambda project -->
    <AWSProjectType>Lambda</AWSProjectType>
  </PropertyGroup>
  
  <ItemGroup>
    <-- This line needs to be removed -->
    <DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="2.2.0" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Amazon.Lambda.Core" Version="1.0.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.Json" Version="1.3.0" />
  </ItemGroup>
</Project>

To migrate this project, you need to delete the DotNetCliToolReference element, including Amazon.Lambda.Tools. If you don't remove this line, the older project tool version of Amazon.Lambda.Tools will be used instead of an installed Global Tool.

The AWS Toolkit for Visual Studio before .NET Core 2.1 would look for the presence of Amazon.Lambda.Tools in the project file to determine whether to show the Lambda deployment menu item. Because we knew we were going to switch to Global Tools, and the reference to Amazon.Lambda.Tools in the project was going away, we added the AWSProjectType property to the project file. The current version of the AWS Toolkit for Visual Studio now looks for either the presence of Amazon.Lambda.Tools or the AWSProjectType set to Lambda. Make sure when removing the DotNetCliToolReference that your project file has the AWSProjectType property to continue deploying with the AWS Toolkit for Visual Studio.

Amazon.Lambda.AspNetCoreServer

Package makes it easy to run ASP.NET Core Web API applications as Lambda functions. For more information see the README.md file for Amazon.Lambda.AspNetCoreServer.

Amazon.Lambda.TestUtilities

Package includes test implementation of the interfaces from Amazon.Lambda.Core and helper methods to help in locally testing. For more information see the README.md file for Amazon.Lambda.TestUtilities.

Blueprints

Blueprints in this repository are .NET Core Lambda functions that can used to get started. In Visual Studio the Blueprints are available when creating a new project and selecting the AWS Lambda Project.

Dotnet CLI Templates

New .NET Core projects can be created with the dotnet new command. By installing the Amazon.Lambda.Templates NuGet package the AWS Lamdba blueprints can be created from the dotnet new command. To install the template execute the following command:

dotnet new -i "Amazon.Lambda.Templates::*"

The ::* on the end of the command indicates the latest version of the NuGet package.

To see a list of the Lambda templates execute dotnet new lambda --list

> dotnet new lambda --list                                                                                             
Templates                                                 Short Name                              Language          Tags

---------------------------------------------------------------------------------------------------------------------------------------------------------
Order Flowers Chatbot Tutorial                            lambda.OrderFlowersChatbot              [C#]              AWS/Lambda/Function

Lambda Detect Image Labels                                lambda.DetectImageLabels                [C#], F#          AWS/Lambda/Function

Lambda Empty Function                                     lambda.EmptyFunction                    [C#], F#          AWS/Lambda/Function

Lex Book Trip Sample                                      lambda.LexBookTripSample                [C#]              AWS/Lambda/Function

Lambda Simple DynamoDB Function                           lambda.DynamoDB                         [C#], F#          AWS/Lambda/Function

Lambda Simple Kinesis Firehose Function                   lambda.KinesisFirehose                  [C#]              AWS/Lambda/Function

Lambda Simple Kinesis Function                            lambda.Kinesis                          [C#], F#          AWS/Lambda/Function

Lambda Simple S3 Function                                 lambda.S3                               [C#], F#          AWS/Lambda/Function

Lambda Simple SQS Function                                lambda.SQS                              [C#]              AWS/Lambda/Function

Lambda ASP.NET Core Web API                               serverless.AspNetCoreWebAPI             [C#], F#          AWS/Lambda/Serverless

Lambda ASP.NET Core Web Application with Razor Pages      serverless.AspNetCoreWebApp             [C#]              AWS/Lambda/Serverless

Serverless Detect Image Labels                            serverless.DetectImageLabels            [C#], F#          AWS/Lambda/Serverless

Lambda DynamoDB Blog API                                  serverless.DynamoDBBlogAPI              [C#]              AWS/Lambda/Serverless

Lambda Empty Serverless                                   serverless.EmptyServerless              [C#], F#          AWS/Lambda/Serverless

Lambda Giraffe Web App                                    serverless.Giraffe                      F#                AWS/Lambda/Serverless

Serverless Simple S3 Function                             serverless.S3                           [C#], F#          AWS/Lambda/Serverless

Step Functions Hello World                                serverless.StepFunctionsHelloWorld      [C#], F#          AWS/Lambda/Serverless

To get details about a template, you can use the help command.

dotnet new lambda.EmptyFunction --help

Template Instantiation Commands for .NET Core CLI.                                                                                          
                                                                                                                                           
Lambda Empty Function (C#)                                                                                                                  
Author: AWS                                                                                                                                 
Options:                                                                                                                                    
  -p|--profile  The AWS credentials profile set in aws-lambda-tools-defaults.json and used as the default profile when interacting with AWS.
                string - Optional                                                                                                           
                                                                                                                                           
  -r|--region   The AWS region set in aws-lambda-tools-defaults.json and used as the default region when interacting with AWS.              
                string - Optional  

The templates take two optional parameters to set the profile and region. These values are written to the aws-lambda-tools-default.json.

To create a function, run the following command

dotnet new lambda.EmptyFunction --name BlogFunction --profile default --region us-east-2

Yeoman (Deprecated)

The Yeoman generators have been deprecated in favor of the new dotnet new templates. They will not be migrated from the older project.json based project system.

aws-lambda-dotnet's People

Contributors

arnd27 avatar austoonz avatar bo67192 avatar chrisoverzero avatar coreycoto avatar costleya avatar ericksoen avatar franciscojclus avatar hvanbakel avatar karpikpl avatar lus1n avatar mabead avatar martincostello avatar normj avatar nwestfall avatar paulfryer avatar rfrerebe avatar samueleresca avatar slang25 avatar slushnas avatar socketnorm avatar stevejroberts avatar szilvaa-adsk avatar thedevopsmachine avatar thrixton avatar toshi0607 avatar vellozzi avatar vlanka avatar wdolek avatar winzig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.