AI prompts
base on Libraries, samples and tools to help .NET Core developers develop AWS Lambda functions. # AWS Lambda for .NET
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](RELEASE.CHANGELOG.md)
## Table of Contents
- [AWS Lambda for .NET Core ![Gitter](https://gitter.im/aws/aws-lambda-dotnet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)](#aws-lambda-for-net-core-img-srchttpsbadgesgitterimjoin20chatsvg-altgitter)
- [Table of Contents](#table-of-contents)
- [NuGet Packages](#nuget-packages)
- [Events](#events)
- [Amazon.Lambda.Tools](#amazonlambdatools)
- [Global Tool Migration](#global-tool-migration)
- [Migrating from DotNetCliToolReference](#migrating-from-dotnetclitoolreference)
- [Amazon.Lambda.Annotations](#amazonlambdaannotations)
- [Amazon.Lambda.AspNetCoreServer](#amazonlambdaaspnetcoreserver)
- [Amazon.Lambda.TestUtilities](#amazonlambdatestutilities)
- [Blueprints](#blueprints)
- [Dotnet CLI Templates](#dotnet-cli-templates)
- [Yeoman (Deprecated)](#yeoman-deprecated)
- [Getting Help](#getting-help)
- [Feedback and Contributing](#feedback-and-contributing)
## NuGet Packages
This repo contains a number of different tools and libraries to support development of Lambda functions using .NET. These packages have individual README docs outlining specific information for that particular package. These packages are cataloged here.
### 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.APIGatewayEvents](Libraries/src/Amazon.Lambda.APIGatewayEvents) - [README.md](Libraries/src/Amazon.Lambda.APIGatewayEvents/README.md)
* [Amazon.Lambda.ApplicationLoadBalancerEvents](Libraries/src/Amazon.Lambda.ApplicationLoadBalancerEvents) - [README.md](Libraries/src/Amazon.Lambda.ApplicationLoadBalancerEvents/README.md)
* [Amazon.Lambda.CloudWatchLogsEvents](Libraries/src/Amazon.Lambda.CloudWatchLogsEvents) - [README.md](Libraries/src/Amazon.Lambda.CloudWatchLogsEvents/README.md)
* [Amazon.Lambda.CognitoEvents](Libraries/src/Amazon.Lambda.CognitoEvents) - [README.md](Libraries/src/Amazon.Lambda.CognitoEvents/README.md)
* [Amazon.Lambda.ConfigEvents](Libraries/src/Amazon.Lambda.ConfigEvents) - [README.md](Libraries/src/Amazon.Lambda.ConfigEvents/README.md)
* [Amazon.Lambda.DynamoDBEvents](Libraries/src/Amazon.Lambda.DynamoDBEvents) - [README.md](Libraries/src/Amazon.Lambda.DynamoDBEvents/README.md)
* [Amazon.Lambda.LexEvents](Libraries/src/Amazon.Lambda.LexEvents) - [README.md](Libraries/src/Amazon.Lambda.LexEvents/README.md)
* [Amazon.Lambda.KinesisAnalyticsEvents](Libraries/src/Amazon.Lambda.KinesisAnalyticsEvents) - [README.md](Libraries/src/Amazon.Lambda.KinesisAnalyticsEvents/README.md)
* [Amazon.Lambda.KinesisEvents](Libraries/src/Amazon.Lambda.KinesisEvents) - [README.md](Libraries/src/Amazon.Lambda.KinesisEvents/README.md)
* [Amazon.Lambda.KinesisFirehoseEvents](Libraries/src/Amazon.Lambda.KinesisFirehoseEvents) - [README.md](Libraries/src/Amazon.Lambda.KinesisFirehoseEvents/README.md)
* [Amazon.Lambda.S3Events](Libraries/src/Amazon.Lambda.S3Events) - [README.md](Libraries/src/Amazon.Lambda.S3Events/README.md)
* [Amazon.Lambda.SimpleEmailEvents](Libraries/src/Amazon.Lambda.SimpleEmailEvents) - [README.md](Libraries/src/Amazon.Lambda.SimpleEmailEvents/README.md)
* [Amazon.Lambda.SNSEvents](Libraries/src/Amazon.Lambda.SNSEvents) - [README.md](Libraries/src/Amazon.Lambda.SNSEvents/README.md)
* [Amazon.Lambda.SQSEvents](Libraries/src/Amazon.Lambda.SQSEvents) - [README.md](Libraries/src/Amazon.Lambda.SQSEvents/README.md)
* [Amazon.Lambda.KafkaEvents](Libraries/src/Amazon.Lambda.KafkaEvents) - [README.md](Libraries/src/Amazon.Lambda.KafkaEvents/README.md)
### Amazon.Lambda.Tools
Package adds commands to the dotnet cli that can be used to manage Lambda functions including deploying a function from the dotnet cli.
For more information see the [README.md](Libraries/src/Amazon.Lambda.Tools/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](https://docs.microsoft.com/en-us/dotnet/core/tools/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.
```xml
<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="2.1.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.Annotations
The Lambda Annotations library allows C# functions to use .NET attributes for a more idiomatic experience
writing Lambda functions. This includes dependency injection integration, simplified access to Lambda event
information and automatic synchronization with CloudFormation template.
For more information see the [README.md](Libraries/src/Amazon.Lambda.Annotations/README.md) file for Amazon.Lambda.Annotations.
### 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](Libraries/src/Amazon.Lambda.AspNetCoreServer/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](Libraries/src/Amazon.Lambda.TestUtilities/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 list --author AWS**
```
> dotnet new list --author AWS
Template Name Short Name Language Tags
------------------------------------------------------------------------------------ -------------------------------------------- -------- ---------------------
Empty Top-level Function lambda.EmptyTopLevelFunction [C#] AWS/Lambda/Serverless
Lambda Annotations Framework (Preview) serverless.Annotations [C#] AWS/Lambda/Serverless
Lambda ASP.NET Core Minimal API serverless.AspNetCoreMinimalAPI [C#] AWS/Lambda/Serverless
Lambda ASP.NET Core Web API serverless.AspNetCoreWebAPI [C#],F# AWS/Lambda/Serverless
Lambda ASP.NET Core Web API (.NET 6 Container Image) serverless.image.AspNetCoreWebAPI [C#],F# AWS/Lambda/Serverless
Lambda ASP.NET Core Web Application with Razor Pages serverless.AspNetCoreWebApp [C#] AWS/Lambda/Serverless
Lambda Custom Runtime Function (.NET 7) lambda.CustomRuntimeFunction [C#],F# AWS/Lambda/Function
Lambda Detect Image Labels lambda.DetectImageLabels [C#],F# AWS/Lambda/Function
Lambda Empty Function lambda.EmptyFunction [C#],F# AWS/Lambda/Function
Lambda Empty Function (.NET 7 Container Image) lambda.image.EmptyFunction [C#],F# AWS/Lambda/Function
Lambda Empty Serverless serverless.EmptyServerless [C#],F# AWS/Lambda/Serverless
Lambda Empty Serverless (.NET 7 Container Image) serverless.image.EmptyServerless [C#],F# AWS/Lambda/Serverless
Lambda Function project configured for deployment using .NET 7's Native AOT feature. lambda.NativeAOT [C#],F# AWS/Lambda/Function
Lambda Giraffe Web App serverless.Giraffe F# AWS/Lambda/Serverless
Lambda Simple Application Load Balancer Function lambda.SimpleApplicationLoadBalancerFunction [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 SNS Function lambda.SNS [C#] AWS/Lambda/Function
Lambda Simple SQS Function lambda.SQS [C#] AWS/Lambda/Function
Lex Book Trip Sample lambda.LexBookTripSample [C#] AWS/Lambda/Function
Order Flowers Chatbot Tutorial lambda.OrderFlowersChatbot [C#] AWS/Lambda/Function
Serverless Detect Image Labels serverless.DetectImageLabels [C#],F# AWS/Lambda/Serverless
Serverless project configured for deployment using .NET 7's Native AOT feature. serverless.NativeAOT [C#],F# AWS/Lambda/Serverless
Serverless Simple S3 Function serverless.S3 [C#],F# AWS/Lambda/Serverless
Serverless WebSocket API serverless.WebSocketAPI [C#] 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.
## Getting Help
To learn more about the various packages in this repo, please reference our [Learning Resources](./Docs/Learning_Resources.md) document. In particular, please be sure to read through the official [Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html).
If those resources are not sufficient to answer your question or resolve your issue, please feel free to open an [issue](https://github.com/aws/aws-lambda-dotnet/issues/new/choose) on this repo.
## Feedback and Contributing
We welcome community contributions to our codebase and tools! If you would like to contribute, please read through the [CONTRIBUTING.md](./CONTRIBUTING.md) document (our contribution guide) and check issues and open pull requests to ensure that the fix/feature you want to contribute is not already in development.
", Assign "at most 3 tags" to the expected json: {"id":"9121","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"