Skip to content

stevehouel/serverless-todo-api

Repository files navigation

Serverless TODO API

Sample code used to demonstrate AWS serverless capabilities

Getting started

  1. Fork this repository on github by clicking here

  2. Create a personal github access token with the following scopes: admin:repo_hook and repo. (It will be used by the CICD pipeline to pull changes from your fork)

  3. Push token to secrets manager

     aws secretsmanager create-secret --name GITHUB_TOKEN --secret-string <YOUR_GITHUB_PERSONAL_ACCESS_TOKEN>
    
  4. Eventually install yarn

  5. Clone the repository

     git clone <URL_OF_THE_REPO>
    
  6. Configure the demonstration

    • in the file serverless-todo-api/bin/cdk.ts , change the ownerName to your Github ownerName

    • in the file serverless-todo-api/bin/cdk.ts , change the domainName to your the domain Name of your choice (this domain name shall be unique and available)

    • in the file serverless-todo-api/lib/pipeline-stack.ts, change the domainName to the domain Name of your choice (this domain name shall be unique and available)

    • Commit and push your changes

  7. Install dependencies

     make bootstrap
    
  8. build CDK package

     make build
    
  9. deploy

     make deploy
    

run stress tests

set the environment variable TODO_API_ENDPOINT to the endpoint of your API Gateway

for example:

export TODO_API_ENDPOINT=$(aws cloudformation describe-stacks --stack-name ServerlessTodoApi-Dev-ServerlessTodoApi-Infra --query "Stacks[0].Outputs[?OutputKey=='todoApiEndpoint6114C0A4'].OutputValue" --output text))

or

export TODO_API_ENDPOINT=https://123456789.execute-api.eu-west-1.amazonaws.com/prod

set the environment variable AWS_REGION to the region where you deployed the demonstration

for example

export AWS_REGION=eu-west-1

then run the stress tests

make stress

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published