Project templates for creating AWS Lambda functions using the Goa framework with built-in support for high-performance, AOT-compiled .NET applications.
Creates a Lambda function for API Gateway integration using ASP.NET Core.
Usage:
dotnet new goa.apigw -n MyApiFunctionOptions:
--functionType- Choose API Gateway type:httpv2(default) - HTTP API with V2 payload formathttpv1- HTTP API with V1 payload formatrestapi- REST API
--includeOpenApi- Include OpenAPI documentation with Scalar UI (default: false)
Features:
- ASP.NET Core routing and endpoints
- JSON source generation for optimal performance
- AOT compilation ready
- Sample
/pingendpoint included
Creates a Lambda function for API Gateway custom authorization.
Usage:
dotnet new goa.authorizer -n MyAuthorizerOptions:
--authorizerType- Choose authorizer type:token(default) - TOKEN authorizer validates using authorization tokenrequest- REQUEST authorizer validates using request parameters
Features:
- TOKEN and REQUEST authorizer support
- PolicyBuilder fluent API for IAM policies
- Support for authorization context data
- Usage plan integration support
- AOT compilation ready
Creates a Lambda function for processing DynamoDB streams.
Usage:
dotnet new goa.dynamodb -n MyDynamoFunctionFeatures:
- Batch processing of DynamoDB stream records
- Dependency injection support
- Record failure handling
- AOT compilation ready
Creates a Lambda function for processing S3 events.
Usage:
dotnet new goa.s3 -n MyS3FunctionOptions:
--processingType- Choose processing mode:batch(default) - Process S3 events as a batchsingle- Process S3 events one at a time
Features:
- Single or batch processing of S3 events
- Support for all S3 event types (ObjectCreated, ObjectRemoved, etc.)
- Event failure handling
- Dependency injection support
- AOT compilation ready
Creates a Lambda function for processing Kinesis stream events.
Usage:
dotnet new goa.kinesis -n MyKinesisFunctionFeatures:
- Batch processing of Kinesis stream records
- Base64 data decoding support
- Record failure handling
- Dependency injection support
- AOT compilation ready
Creates a Lambda function for processing EventBridge events.
Usage:
dotnet new goa.eventbridge -n MyEventBridgeFunctionFeatures:
- Single event processing
- Access to event source, detail type, and custom detail data
- Event failure handling
- Dependency injection support
- AOT compilation ready
Creates a Lambda function for processing SQS messages.
Usage:
dotnet new goa.sqs -n MySqsFunctionOptions:
--processingType- Choose processing mode:batch(default) - Process SQS messages as a batchsingle- Process SQS messages one at a time
Features:
- Single or batch processing of SQS messages
- Access to message body, attributes, and metadata
- Message failure handling for retry/DLQ
- Dependency injection support
- AOT compilation ready
-
Install the template package:
dotnet new install Goa.Templates
-
Create a new function:
# Basic API Gateway function dotnet new goa.apigw -n MyFunction # With OpenAPI documentation dotnet new goa.apigw -n MyFunction --includeOpenApi true # API Gateway authorizer (TOKEN type) dotnet new goa.authorizer -n MyAuthorizer # API Gateway authorizer (REQUEST type) dotnet new goa.authorizer -n MyAuthorizer --authorizerType request # DynamoDB stream function dotnet new goa.dynamodb -n MyDynamoFunction # S3 event function (batch processing) dotnet new goa.s3 -n MyS3Function # S3 event function (single processing) dotnet new goa.s3 -n MyS3Function --processingType single # Kinesis stream function dotnet new goa.kinesis -n MyKinesisFunction # EventBridge event function dotnet new goa.eventbridge -n MyEventBridgeFunction # SQS message function (batch processing) dotnet new goa.sqs -n MySqsFunction # SQS message function (single processing) dotnet new goa.sqs -n MySqsFunction --processingType single cd MyFunction
-
Build and deploy:
dotnet publish -c Release # Deploy using your preferred method (SAM, CDK, etc.)
- .NET 10.0 SDK or later
- AWS CLI configured for deployment
Visit the Goa documentation for more information about the framework and deployment options.