Coder Social home page Coder Social logo

aws-samples / cookiecutter-aws-sam-dotnet Goto Github PK

View Code? Open in Web Editor NEW
25.0 16.0 9.0 109 KB

A cookiecutter template to create a .NET based AWS Lambda function and test using a Visual Studio folder structure and .NET 6

License: MIT No Attribution

Python 5.68% C# 94.32%
dotnetcore csharp aws-sam-cli aws aws-serverless

cookiecutter-aws-sam-dotnet's Introduction

AWS SAM Cookiecutter for .NET Lambda functions

A Cookiecutter template to create a Serverless application using the AWS Serverless Application Model Command Line Interface (AWS SAM CLI) and .NET 6.

This template follows the default directory structure of Visual Studio solutions (including a test project), and also includes core utilities - Logging, Metrics and Tracing - for the AWS Lambda Powertools for .NET. To see how to leverage all of Powertools functionality vistit the documentation https://awslabs.github.io/aws-lambda-powertools-dotnet/.

Do not git clone this project unless you want to fork it to create your own project template. To create a Serverless application from this template follow the instructions below and use the AWS SAM CLI instead.

Requirements

Cookiecutter install

Install cookiecutter command line:

  • Pip users: pip install cookiecutter
  • Homebrew users: brew install cookiecutter
  • Windows or Pipenv users: pipenv install cookiecutter

AWS SAM CLI install

To use the AWS SAM CLI, you need the following tools.

Microsoft .NET 6 install

You will need the following for local testing.

Usage

The sam init command initializes a serverless application with an AWS SAM template, or a template or application you specify. Use the location parameter to pass the location of this project

sam init --location gh:aws-samples/cookiecutter-aws-sam-dotnet

alternatively you can use Cookiecutter command:

cookiecutter gh:aws-samples/cookiecutter-aws-sam-dotnet`. 

You'll be prompted a few questions to help this cookiecutter template to scaffold this project. After it's completed, you should see a new folder at your current path with the name of the project you specified as input.

NOTE: After you understand how cookiecutter works (cookiecutter.json, mainly), you can fork this repo and apply your own mechanisms to accelerate your development process and this can be followed for any programming language and OS.

Options

Option Description
solution_name Name of the Visual Studio solution file
project_name Name of the Visual Studio project
include_safe_deployment Sends by default 10% of traffic for every 1 minute to a newly deployed function using CodeDeploy + SAM integration - Linear10PercentEvery1Minute

Credits

License Summary

This sample code is made available under a modified MIT license. See the LICENSE file.

cookiecutter-aws-sam-dotnet's People

Contributors

jpeddicord avatar sliedig avatar vrioux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cookiecutter-aws-sam-dotnet's Issues

Template error: instance of Fn::GetAtt references undefined resource

In the file template.yaml, the rows:
Value: !GetAtt {{ cookiecutter.project_name }}.Arn
Value: !GetAtt {{ cookiecutter.project_name }}Role.Arn

must be:
Value: !GetAtt {{ cookiecutter.project_name }}Function.Arn
Value: !GetAtt {{ cookiecutter.project_name }}FunctionRole.Arn

Because the resource name is:
{{ cookiecutter.project_name }}Function:

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.