Sample serverless blog engine powered by AWS C# Lambda functions.
This repository shows how to build a sample blog engine using AWS C# lambda functions. The repository uses multiple branches that map from simple to advanced implementations.
To begin, make sure the following tools are installed.
- Install .NET Core 1.0
- Install nodejs
- Install Yeoman
npm install -g yo generator-aws-lambda-dotnet
- Create a IAM user in the AWS console (e.g.
lambdasharp
) - Create a
lambdasharp
AWS configuration in~/.aws/credentials
Now you should be ready to publish
By default, this sample blog will create the DynamoDB table as part of the CloudFormation template. You can edit
src/SampleLambdaBlog/aws-lambda-tools-defaults.json
to adjust defaults for publishing. Please review profile
and
region
BEWARE by default, the API Gateway created by the CloudFormation stack is public and vulnerable to abuse!
You can find the URI for your SampleLambdaBlog API as follows:
- Open the AWS console
- Select
API Gateway
- Select
SampleLambdaBlog
- Select
Dashboard
The URI will be shown at the top of the page. The URIs in the examples below will NOT WORK for you unless you replace the URI!
The following curl
command will return an empty list []
unless a blog entry was added.
curl https://SampleLambdaBlog.execute-api.us-east-1.amazonaws.com/Prod/
The following curl
command will return the GUID of the new blog entry when it succeeds.
curl -X PUT -H "Content-Type: application/json" -d '{"Name":"John","Content":"What John wrote."}' https://SampleLambdaBlog.execute-api.us-east-1.amazonaws.com/Prod/