Sikau

AWS · Day 8 · about 55 min

Capstone: A serverless order service

Lambda routes with IAM checks, DynamoDB storage and an SQS worker.

A real cloud architecture

Put it together: API Gateway sends requests to a Lambda handler; it checks IAM permissions, stores orders in DynamoDB with single-table keys, and drops a message on SQS so a worker ships orders in the background. Every piece scales on its own and costs nothing when idle.

The architecture

Requests arrive through API Gateway at one Lambda handler with routes for creating and reading orders. Each route first asks IAM whether the caller may perform the action on that order. Orders are stored in a DynamoDB table using single-table keys. Creating an order also sends a message to SQS, and a separate worker function ships orders from the queue.

  • POST /orders → isAllowed("orders:Create") → put in DynamoDB → send to SQS → 201.
  • GET /orders/{id} → isAllowed("orders:Read", arn) → get → 200 or 404.
  • fulfil() → receive from SQS → mark shipped → delete the message.
  • Each piece scales independently and costs nothing when idle.

Build in the same order as the course: IAM checks, then routes, then storage, then the queue and worker.

The rest of this lesson

  • Permissions per requestexplain
  • The worker, safelyexplain
  • Placing an orderorder
  • Service to jobmatch
  • createOrderServicechallenge
  • Badge quizquiz
  • AWS: complete!recap

Continue this lesson free — run real code in your browser

Continue with Google

See all 8 lessons of AWS