Code Monkey home page Code Monkey logo

adilshehzad786 / workshop-restapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from donnieprakoso/workshop-restapi

0.0 1.0 0.0 332 KB

In this workshop, you will build and deploy a REST API using Amazon API Gateway, AWS Lambda, and AWS CDK (and a bit of Amazon DynamoDB). The main objective of this workshop is to build a foundation of understanding how to implement REST API with AWS and also how to adopt IaC for reusable APIs.

License: Apache License 2.0

Python 97.45% Shell 2.55%

workshop-restapi's Introduction

๐Ÿš€ Workshop โ€” Building REST APIs with AWS

In this workshop, you will build and deploy REST APIs using Amazon API Gateway, AWS Lambda, and AWS CDK (and a bit of Amazon DynamoDB). The main objective of this workshop is to build a foundation of understanding how to implement REST API with AWS and also how to adopt IaC for reusable APIs.

The content of this workshop will be updated regularly and if you have questions or find issues in this workshop, please file them as an Issue.

Workshop Structure

Each lab in this workshop can be run separately. Each labs consist of full working source code along with AWS CDK to easily provision and destroy created resources.

Lab 1: Integrating AWS Lambda with Amazon DynamoDB

The objective of this lab is to help you understand how to develop AWS Lambda to perform some activities with Amazon DynamoDB. This is considered as a good exercise โ€”ย as you develop APIs with AWS serverless services โ€” you will encounter many use-cases that requires integration between AWS Lambda and Amazon DynamoDB.

In this workshop, you will build 2 AWS Lambda Functions. One AWS Lambda Function will store data, and another Lambda Function to retrieve all data from a single table in Amazon DynamoDB. This is a basic exercise to help you understand how to perform basic data storing and retrieval from Lambda functions. All of resources needed in this lab will be provisioned by AWS Cloud Development Kit (CDK).

๐Ÿ’ป Start This Lab

Lab 2: Implementing REST API with Amazon API Gateway

This lab is the main content of this workshop where you are going to implement REST API with Amazon API Gateway, AWS Lambda and Amazon DynamoDB. You will learn how to build resources following REST API guidelines using HTTP protocol and methods.

You will build 4 AWS Lambda Functions, each of them are integrated with Amazon API Gateway endpoint and respective HTTP method. There are few small details in this lab that you'll find useful while building your API, for examples: defining resources and how to get URL parameters.

๐Ÿ’ป Start This Lab

Lab 3: Controlling Access with Lambda Authorizer

In this lab, you will build a basic API that needs to be secured by Lambda Authorizer using token. The token takes form of JWT. Please be noted that in this lab we will not cover authentication and authorizatio platform.

You will learn how to use Lambda Authorizer and how to integrate with Amazon API Gateway using AWS CDK, to control the access of your API.

๐Ÿ’ป Start This Lab


Workshop Level

This workshop welcomes developers of all levels.

This workshop is structured as puzzles in which you need to complete a set of partial codes into a complete code. It is an intended design to help build an understanding of a specific concept. Also, to help you get familiar with common resources needed to develop with AWS services.


๐Ÿ›‘ First Thing First

If this is your first time using this workshop, this section is an important piece that you need to read before moving on.

โš ๏ธ

Please make sure that your development environment meets the requirements below and properly configured before starting any of the workshops.

Workshop Requirements

Requirement More Information Notes
Active AWS Account Link Mandatory requirement
AWS CDK Link Require Node JS
AWS CLI Link Require active AWS account. Please configure your account as described on this page
Python 3.8 Link Most of the workshop will be using Python 3.8
Boto3 Link Amazon Web Services (AWS) Software Development Kit (SDK) for Python
Node JS 10.30 or later Link Node.js versions 13.0.0 through 13.6.0 are not compatible with the AWS CDK

โš ๏ธ

Since we will be using AWS CDK extensively in this workshop, please properly configure AWS CDK for your development environment.

If you haven't done that, please follow the instruction here.

In summary, here's a quick checklist to complete the required checking.

  • Installed AWS CLI
  • Configured AWS CLI with aws configure
  • Installed Node JS
  • Installed AWS CDK with npm install -g aws-cdk
  • Configured AWS CDK with cdk bootstrap

๐Ÿ’ก HINT and ๐Ÿ˜• Are you stuck?

For the more complex tasks that you need to complete, there will be a ๐Ÿ’ก HINT to guide you on how to solve it. Most of the time, it will also include link(s) for further reading.

Please remember that if you are stuck and can't move to the next step, you can always see the main reference file to see the solution. For easy access, ๐Ÿ˜• Are you stuck? will guide you directly to the solution.

AWS Services

Some of the services from AWS that are used in this workshop are as follows:

โš ๏ธ Cleaning Up

This workshop uses AWS services that are mostly covered by the Free Tier allowance - ONLY if your account is less than 12 months old. For accounts passed the free tier eligibility, it may incur some costs. To minimize the cost, make sure you delete resources used in this workshop when you are finished.

All of the labs in this workshop use a standardized cleaning method with AWS CDK.

  1. Go to each lab
  2. Change the directory to cdk /
  3. Run cdk destroy
  4. If in some cases it fails, you need to go to AWS CloudFormation to manually delete the stack.

workshop-restapi's People

Contributors

donnieprakoso avatar

Watchers

 avatar

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.