Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

The Simple Webservice

This is an example CDK stack to deploy The Simple Webservice stack described by Jeremy Daly here - https://www.jeremydaly.com/serverless-microservice-patterns-for-aws/#simplewebservice

Most of this code was borrowed from https://www.cdkworkshop.com

This is the most basic of implementations and would have to be hardened before production use. e.g. cognito added to the API Gateway

Architecture

After deployment you should have a proxy api gateway where any url hits a lambda which inserts a record of the url into a dynamodb with a count of how many times that url has been visited.

Useful commands

  • dotnet build src compile this app
  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template

Deploy with AWS Cloud9

  • Create an Ubuntu AWS Cloud9 EC2 development environment
  • Add the Microsoft repository
    wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
    
    sudo dpkg -i packages-microsoft-prod.deb
    
  • Install the .NET Core SDK
    sudo apt-get update; \
    sudo apt-get install -y apt-transport-https && \
    sudo apt-get update && \
    sudo apt-get install -y dotnet-sdk-3.1
    
  • Clone the CDK Patterns repo
    git clone https://github.com/cdk-patterns/serverless.git
    
  • Change directory
    cd serverless/the-simple-webservice/csharp
    
  • Build the project to see if .NET Core has been setup correctly (optional)
    dotnet build src
    
  • Deploy the stack
    cdk deploy