ЁЯПл The SchoolтА║ЁЯЫОя╕П API GatewayтА║ЁЯЫОя╕П рдзрдбрд╛ 01 тАФ API gateway рдХрд╛: рд╢рд╛рд│реЗрдЪреЗ front office
ЁЯЦ╝я╕П See the drawing + lab ЁЯПа Course home ЁЯМ┐ Branch on GitHub тЬПя╕П View source
ЁЯЦ╝я╕П рдЖрдХреГрддреА рдЖрдгрд┐ labThe drawing + lab рдкреВрд░реНрдг рдкрд╛рдирд╛рд╡рд░ рдЙрдШрдбрд╛ тЖЧOpen full page тЖЧ

ЁЯЫОя╕П рдзрдбрд╛ 01 тАФ API gateway рдХрд╛: рд╢рд╛рд│реЗрдЪреЗ front office

ЁЯУН рддреБрдореНрд╣реА рдЗрдереЗ рдЖрд╣рд╛рдд: 12 рдкреИрдХреА рдзрдбрд╛ 01 ┬╖ рдкреБрдвреЗ: lesson-02-rest-http-websocket


ЁЯУж рдпрд╛ рдмреНрд░рдБрдЪрдордзреНрдпреЗ рдХрд╛рдп рдЖрд╣реЗ

рд╕рдВрдкреВрд░реНрдг рдХреЛрд░реНрд╕рдорд╛рдЧрдЪреА рдПрдХрдЪ рдХрд▓реНрдкрдирд╛: рдкреНрд░рддреНрдпреЗрдХ kitchen рд╕рдореЛрд░ рдПрдХрдЪ front office рдареЗрд╡рд╛. рддреЗ рдкреНрд░рддреНрдпреЗрдХ visitor рд▓рд╛ рддрдкрд╛рд╕рддреЗ, рдореЛрдЬрддреЗ, рд▓рдХреНрд╖рд╛рдд рдареЗрд╡рддреЗ рдЖрдгрд┐ рдкреБрдвреЗ рдкрд╛рдард╡рддреЗ, рддреНрдпрд╛рдореБрд│реЗ рдкреНрд░рддреНрдпреЗрдХ kitchen рд▓рд╛ рдлрдХреНрдд рд╕реНрд╡рдпрдВрдкрд╛рдХ рдХрд░рд╛рдпрдЪрд╛ рдЕрд╕рддреЛ. AWS рдордзреНрдпреЗ рддреЗ office рдореНрд╣рдгрдЬреЗ Amazon API Gateway. рдкреВрд░реНрдг рдХреЛрд░реНрд╕рднрд░ рддреБрдореНрд╣реА рд╡рд╛рдкрд░рд╛рд▓ рддреНрдпрд╛ рдЦрд▒реНрдпрд╛ files:

ЁЯОТ рд╕реБрд░реВ рдХрд░рдгреНрдпрд╛рдЖрдзреА: рддреБрдореНрд╣рд╛рд▓рд╛ рдлрдХреНрдд Python 3 рд▓рд╛рдЧрддреЗ, рджреБрд╕рд░реЗ рдХрд╛рд╣реАрд╣реА рдирд╛рд╣реА тАФ AWS account рдирд╛рд╣реА, pip install рдирд╛рд╣реА. gateway.py рд╣реЗ рд╢рд┐рдХрд╡рдгреНрдпрд╛рд╕рд╛рдареАрдЪреЗ model рдЖрд╣реЗ: AWS docs рд╕рд╛рдВрдЧрддрд╛рдд рддреЛ рдХреНрд░рдо рдЖрдгрд┐ defaults рддреЗ рдкрд╛рд│рддреЗ, рдкрдг рдЦрд▒реНрдпрд╛ API Gateway рдордзреНрдпреЗ рдЦреВрдк рдЬрд╛рд╕реНрдд settings рдЖрд╣реЗрдд. рддреНрдпрд╛рдЪреА JWT check HS256 рд╡рд╛рдкрд░рддреЗ рдореНрд╣рдгреВрди рддреНрдпрд╛рд▓рд╛ crypto library рд▓рд╛рдЧрдд рдирд╛рд╣реА; рдЦрд░реЗ JWT authorizers RS256 signatures issuer рдЪреНрдпрд╛ public keys рд╡рд┐рд░реБрджреНрдз рддрдкрд╛рд╕рддрд╛рдд. on a real account рдЕрд╢реА рдЦреВрдг рдЕрд╕рд▓реЗрд▓реНрдпрд╛ commands рдирд╛ AWS CLI рдЖрдгрд┐ credentials рд▓рд╛рдЧрддрд╛рдд; рдмрд╛рдХреА рд╕рдЧрд│реЗ рдЗрдереЗрдЪ рдЪрд╛рд▓рддреЗ.

ЁЯзТ 5 рд╡рд░реНрд╖рд╛рдВрдЪреНрдпрд╛ рдореБрд▓рд╛рд▓рд╛ рд╕рдордЬрд╛рд╡рд▓реНрдпрд╛рд╕рд╛рд░рдЦреЗ

рдПрдХрд╛ рдореЛрдареНрдпрд╛ рд╢рд╛рд│реЗрдд рдЕрдиреЗрдХ kitchens ЁЯН│ рдЕрд╕рддрд╛рдд тАФ рдПрдХ рд╡рд┐рджреНрдпрд╛рд░реНрдереНрдпрд╛рдВрдЪреНрдпрд╛ рдиреЛрдВрджреА рдмрдирд╡рддреЗ, рдПрдХ marks рдмрдирд╡рддреЗ, рдПрдХ рд╡реЗрд│рд╛рдкрддреНрд░рдХреЗ рдмрдирд╡рддреЗ. рджрд┐рд╡рд╕рднрд░ visitors рдпреЗрдд рдЕрд╕рддрд╛рдд: рдкрд╛рд▓рдХ, рд╢рд┐рдХреНрд╖рд┐рдХрд╛, apps, рдЗрддрд░ рд╢рд╛рд│рд╛.

Front office рдирд╕реЗрд▓ рддрд░ рдкреНрд░рддреНрдпреЗрдХ kitchen рд▓рд╛ рд╕рдЧрд│реЗ рдХрд╛рд╣реА рд╕реНрд╡рддрдГрдЪ рдХрд░рд╛рд╡реЗ рд▓рд╛рдЧрддреЗ: visitor рдХреЛрдг рдЖрд╣реЗ рддреЗ рддрдкрд╛рд╕рдгреЗ, рдХрд┐рддреА рдЖрд▓реЗ рддреЗ рдореЛрдЬрдгреЗ, рдЧрд░реНрджреА рдерд╛рдВрдмрд╡рдгреЗ, visitor book рд▓рд┐рд╣рд┐рдгреЗ, рдЖрдгрд┐ рд╕реНрд╡рдпрдВрдкрд╛рдХрд╣реА. рдкреНрд░рддреНрдпреЗрдХ kitchen рд╣реЗ рдереЛрдбреЗ рд╡реЗрдЧрд│реЗ рдХрд░рддреЗ, рдЖрдгрд┐ рддреНрдпрд╛рддрд▓реЗ рдПрдХ рдиреЗрд╣рдореА рдХрд╛рд╣реАрддрд░реА рд╡рд┐рд╕рд░рддреЗ.

рдореНрд╣рдгреВрди рд╢рд╛рд│рд╛ рдлрд╛рдЯрдХрд╛рд╡рд░ рдПрдХрдЪ front office ЁЯЫОя╕П рдмрд╛рдВрдзрддреЗ. рддрд┐рдереЗ рдПрдХ clerk рдмрд╕рддреЛ. рдкреНрд░рддреНрдпреЗрдХ visitor рдЖрдзреА рддреНрдпрд╛ desk рд╡рд░ рдерд╛рдВрдмрддреЛ. Clerk:

Kitchens рд▓рд╣рд╛рди рдЖрдгрд┐ рд╕реЛрдкреА рд░рд╛рд╣рддрд╛рдд. рддреЗ front office рдореНрд╣рдгрдЬреЗрдЪ API gateway.

ЁЯЧ║я╕П рдЖрдХреГрддреА

flowchart LR
    v["ЁЯСк visitors<br/>apps ┬╖ browsers ┬╖ partners"]
    office["ЁЯЫОя╕П front office тАФ API Gateway<br/>badge check ┬╖ count ┬╖ notice board ┬╖ visitor book"]
    k1["ЁЯН│ kitchen: students<br/>GET /students/{id}"]
    k2["ЁЯН│ kitchen: marks<br/>POST /marks"]
    no["ЁЯЪл 404 Not Found<br/>no such kitchen"]
    log["ЁЯУТ visitor book<br/>metrics + access log"]
    v -->|"1 every request"| office
    office -->|"2 forward"| k1
    office -->|"2 forward"| k2
    office -.->|"no route"| no
    office -.->|"3 write it down"| log

ЁЯЧ║я╕П рдХрд╛рдврд▓реЗрд▓реА рдЖрд╡реГрддреНрддреА + рдПрдХ lab: https://school-edh.pages.dev/apigateway/lesson-diagrams.html#l01

тЭУ рдХрд╛рдп

ЁЯдФ рдХрд╛

рдХрд╛рд░рдг auth, limits, logging рдЖрдгрд┐ TLS рд╣реЗ рдкреНрд░рддреНрдпреЗрдХ service рд╕рд╛рдареА рддреЗрдЪ рдХрд╛рдо рдЖрд╣реЗ, рдЖрдгрд┐ рддреНрдпрд╛рдд рдЪреВрдХ рд╣реЛрдгреЗ рд╕реЛрдкреЗ рдЖрд╣реЗ. рдкреНрд░рддреНрдпреЗрдХ service рддреЗ рдПрдХрдЯреАрдЪ рдмрдирд╡рддреЗ рддреЗрд╡реНрд╣рд╛ рдПрдХ token expiry рд╡рд┐рд╕рд░рддреЗ, рджреБрд╕рд░реАрд▓рд╛ rate limit рдирд╕рддреЗ, рддрд┐рд╕рд░реА рдХрд╛рд╣реАрдЪ log рдХрд░рдд рдирд╛рд╣реА. Gateway рд╣реЗ рдХрд╛рдо рдПрдХрджрд╛рдЪ, рдПрдХрд╛рдЪ рдЬрд╛рдЧреА, рд╕рдЧрд│реНрдпрд╛рдВрд╕рд╛рдареА рдПрдХрд╛рдЪ рдкрджреНрдзрддреАрдиреЗ рдХрд░рддреЗ. рдордЧ kitchens рдордзреНрдпреЗ рдлрдХреНрдд business logic рд░рд╛рд╣рддреЗ тАФ рдЖрдгрд┐ рддреНрдпрд╛рдВрдирд╛ рд╣рд╛рдд рди рд▓рд╛рд╡рддрд╛ рддреБрдореНрд╣реА рджрд╛рд░рд╛рд╡рд░рдЪреЗ рдирд┐рдпрдо рдмрджрд▓реВ рд╢рдХрддрд╛.

ЁЯФз рдХрд╕реЗ (рдпрд╛ repo рдордзреНрдпреЗ)

apigw/demo.py рдордзрд▓реЗ office() рд╢рд╛рд│реЗрдЪреЗ gateway (school-api) рджреЛрди stages (dev, prod) рдЖрдгрд┐ рдЖрда routes рд╕рд╣ рдмрдирд╡рддреЗ. apigw/gateway.py рдордзрд▓реЗ Gateway.handle() рдкреНрд░рддреНрдпреЗрдХ request рд▓рд╛ рдПрдХрд╛рдЪ рд░рд╛рдВрдЧреЗрддреВрди рдиреЗрддреЗ: CORS preflight тЖТ route match тЖТ API key тЖТ authorizer тЖТ throttle тЖТ validation тЖТ cache тЖТ integration тЖТ response mapping тЖТ access log. why() рдПрдХ рдпреЛрдЧреНрдп request рдЖрдгрд┐ рдЕрд╕реНрддрд┐рддреНрд╡рд╛рдд рдирд╕рд▓реЗрд▓реНрдпрд╛ kitchen рд╕рд╛рдареА рдПрдХ request рдкрд╛рдард╡рддреЗ. serve() рддреЗрдЪ office рдлрдХреНрдд standard library рд╡рд╛рдкрд░реВрди http://localhost:8080 рд╡рд░ рдЙрдШрдбрддреЗ.

ЁЯзк рдХрд░реВрди рдкрд╛рд╣рд╛

python3 apigw/demo.py why
python3 - <<'EOF'
import sys; sys.path.insert(0, "apigw"); from demo import office
gw, clock = office()
for p in ("/students/7", "/students/9", "/teachers"):
    st, headers, out = gw.handle("GET", p)
    print(st, p, out)
print(gw.metrics)
print(gw.logs[-1])
EOF
python3 apigw/test_apigw.py

рдЖрддрд╛ office рдЦрд░реЛрдЦрд░ рдЙрдШрдбрд╛ рдЖрдгрд┐ curl рдиреЗ рджрд╛рд░рд╛рд╡рд░ рдЯрдХрдЯрдХ рдХрд░рд╛:

python3 apigw/demo.py serve &          # the office opens on localhost:8080
sleep 1                                # give the office a second to open
curl -i localhost:8080/students/7
curl -i localhost:8080/students/7      # the same question again
curl -i localhost:8080/teachers
kill %1                                # close the office

тЬЕ рддрдкрд╛рд╕рд╛ тАФ рддреБрдореНрд╣рд╛рд▓рд╛ рдХрд╛рдп рджрд┐рд╕рд╛рдпрд▓рд╛ рд╣рд╡реЗ

why рд╣реЗ GET /students/7 тЖТ 200 {'id': '7', 'name': 'Aishwarya', 'class': '8B'} X-Cache: Miss рдЖрдгрд┐ GET /teachers тЖТ 404 {'message': 'Not Found'} print рдХрд░рддреЗ. рддреБрдордЪрд╛ snippet /students/7 рдЖрдгрд┐ /students/9 рд╕рд╛рдареА 200, 404 /teachers {'message': 'Not Found'}, рдордЧ counters {'Count': 3, '4XXError': 1, '5XXError': 0, 'CacheHitCount': 0, 'CacheMissCount': 2} рдЖрдгрд┐ visitor book рдЪреА рд╢реЗрд╡рдЯрдЪреА рдУрд│ print рдХрд░рддреЛ: {'requestId': 'req-0003', 'stage': 'prod', 'httpMethod': 'GET', 'path': '/teachers', 'status': 404, 'principal': None, 'latencyMs': 4, 'integrationLatencyMs': 0}. Tests 12/12 passed рдиреЗ рд╕рдВрдкрддрд╛рдд.

рдЪрд╛рд▓реВ office рд╕рд╣: server front office open on http://localhost:8080 (stage prod) тАФ Ctrl+C to close print рдХрд░рддреЛ. рдкрд╣рд┐рд▓рд╛ curl HTTP/1.0 200 OK, X-Cache: Miss рдЖрдгрд┐ {"id": "7", "name": "Aishwarya", "class": "8B"} рджрд╛рдЦрд╡рддреЛ; рджреБрд╕рд░рд╛ X-Cache: Hit рджрд╛рдЦрд╡рддреЛ тАФ office рдиреЗ рддреНрдпрд╛рдЪреНрдпрд╛ рд╕реВрдЪрдирд╛ рдлрд▓рдХрд╛рд╡рд░реВрди рдЙрддреНрддрд░ рджрд┐рд▓реЗ. /teachers рд╣реЗ HTTP/1.0 404 Not Found рдЖрдгрд┐ {"message": "Not Found"} рджрд╛рдЦрд╡рддреЗ.

ЁЯПБ рддреБрдореНрд╣реА рдЖрддреНрддрд╛рдЪ рдХрд╛рдп рд╕рд┐рджреНрдз рдХреЗрд▓реЗ

рдкреНрд░рддреНрдпреЗрдХ visitor рдПрдХрд╛рдЪ desk рд╡рд░реВрди рдЬрд╛рддреЛ. Desk рдиреЗ рдкреНрд░рддреНрдпреЗрдХ рднреЗрдЯреАрдЪреЗ рдЙрддреНрддрд░ рджрд┐рд▓реЗ, рддреА рдореЛрдЬрд▓реА, рд▓рдХреНрд╖рд╛рдд рдареЗрд╡рд▓реА рдЖрдгрд┐ рд▓рд┐рд╣реВрди рдареЗрд╡рд▓реА тАФ рдЖрдгрд┐ kitchen рд▓рд╛ рдлрдХреНрдд рдЧрд░рдЬ рдЕрд╕реЗрд▓ рддреЗрд╡реНрд╣рд╛рдЪ рд╡рд┐рдЪрд╛рд░рд▓реЗ рдЧреЗрд▓реЗ.

тЪая╕П рдиреЗрд╣рдореАрдЪреНрдпрд╛ рдЪреБрдХрд╛

ЁЯПн рдкреНрд░рддреНрдпрдХреНрд╖ рд╡рд╛рдкрд░рд╛рдд

On a real account тАФ рддреБрдордЪреЗ REST рдЖрдгрд┐ HTTP APIs list рдХрд░рд╛, рдЖрдгрд┐ рдЖрдзреАрдкрд╛рд╕реВрди рдЕрд╕рд▓реЗрд▓реНрдпрд╛ Lambda function рд╕рдореЛрд░ рдПрдХрд╛рдЪ command рдиреЗ HTTP API рдмрдирд╡рд╛ ("quick create"):

aws apigateway get-rest-apis --query 'items[].{name:name,id:id}'
aws apigatewayv2 get-apis --query 'Items[].{name:Name,id:ApiId,type:ProtocolType}'
aws apigatewayv2 create-api --name school-api --protocol-type HTTP \
    --target arn:aws:lambda:ap-south-1:111122223333:function:students

ЁЯПн Production рдордзреНрдпреЗ рд╣реЗ рдХрд╛ рдорд╣рддреНрддреНрд╡рд╛рдЪреЗ: рдмрд╣реБрддреЗрдХ AWS serverless systems Lambda рд╕рдореЛрд░ API Gateway рдареЗрд╡рддрд╛рдд, рдореНрд╣рдгрдЬреЗ auth, throttling рдЖрдгрд┐ logging рдПрдХрд╛рдЪ рддрдкрд╛рд╕рд▓реЗрд▓реНрдпрд╛ рдЬрд╛рдЧреА рд░рд╛рд╣рддрд╛рдд. рдкрд╣рд┐рд▓рд╛ review рдкреНрд░рд╢реНрди рд╕реЛрдкрд╛ рдЕрд╕рддреЛ: рдХреЛрдгрддреЗ routes рдЖрд╣реЗрдд, рдЖрдгрд┐ рдкреНрд░рддреНрдпреЗрдХрд╛рд▓рд╛ рдХреЛрдг call рдХрд░реВ рд╢рдХрддреЛ?

тПня╕П рдкреБрдвреЗ

Office рддрдпрд╛рд░ рдЖрд╣реЗ. рдкрдг AWS рддреАрди рдкреНрд░рдХрд╛рд░рдЪреА front offices рджреЗрддреЗ тАФ рдПрдХ рдкреВрд░реНрдг, рдПрдХ рд╣рд▓рдХреЗ, рдЖрдгрд┐ рдПрдХ рдЬреНрдпрд╛рдд phone line рдЙрдШрдбреА рд░рд╛рд╣рддреЗ.

git checkout lesson-02-rest-http-websocket

ЁЯЫОя╕П Lesson 01 тАФ Why an API gateway: the school's front office

ЁЯУН You are here: Lesson 01 of 12 ┬╖ Next: lesson-02-rest-http-websocket


ЁЯУж What's in this branch

The one idea behind the whole course: put one front office in front of every kitchen. It checks, counts, remembers and forwards every visitor, so each kitchen only has to cook. In AWS that office is Amazon API Gateway. Real files you will use all the way through:

ЁЯОТ Before you start: you need Python 3 and nothing else тАФ no AWS account, no pip install. gateway.py is a teaching model: it follows the order and the defaults the AWS docs describe, but real API Gateway has many more settings. Its JWT check uses HS256 so it needs no crypto library; real JWT authorizers check RS256 signatures against the issuer's public keys. Commands marked on a real account need the AWS CLI and credentials; everything else runs here.

ЁЯзТ Explain like I'm 5

A big school has many kitchens ЁЯН│ тАФ one makes student records, one makes marks, one makes timetables. Visitors come all day: parents, teachers, apps, other schools.

Without a front office, every kitchen must do everything itself: check who the visitor is, count how many came, stop a crowd, write the visitor book, and cook. Every kitchen does it a little differently, and one of them always forgets.

So the school builds one front office ЁЯЫОя╕П at the gate. A clerk sits there. Every visitor stops at the desk first. The clerk:

The kitchens stay small and simple. That front office is an API gateway.

ЁЯЧ║я╕П Diagram

flowchart LR
    v["ЁЯСк visitors<br/>apps ┬╖ browsers ┬╖ partners"]
    office["ЁЯЫОя╕П front office тАФ API Gateway<br/>badge check ┬╖ count ┬╖ notice board ┬╖ visitor book"]
    k1["ЁЯН│ kitchen: students<br/>GET /students/{id}"]
    k2["ЁЯН│ kitchen: marks<br/>POST /marks"]
    no["ЁЯЪл 404 Not Found<br/>no such kitchen"]
    log["ЁЯУТ visitor book<br/>metrics + access log"]
    v -->|"1 every request"| office
    office -->|"2 forward"| k1
    office -->|"2 forward"| k2
    office -.->|"no route"| no
    office -.->|"3 write it down"| log

ЁЯЧ║я╕П Drawn version + a lab: https://school-edh.pages.dev/apigateway/lesson-diagrams.html#l01

тЭУ What

ЁЯдФ Why

Because auth, limits, logging and TLS are the same work for every service, and they are easy to get wrong. When each service builds them alone, one forgets the token expiry, another has no rate limit, a third logs nothing. A gateway does this work once, in one place, the same way for everyone. The kitchens then hold only business logic тАФ and you can change the rules at the door without touching them.

ЁЯФз How (in this repo)

office() in apigw/demo.py builds the school's gateway (school-api) with two stages (dev, prod) and eight routes. Gateway.handle() in apigw/gateway.py walks every request down the same line: CORS preflight тЖТ route match тЖТ API key тЖТ authorizer тЖТ throttle тЖТ validation тЖТ cache тЖТ integration тЖТ response mapping тЖТ access log. why() sends one good request and one request for a kitchen that does not exist. serve() puts the same office on http://localhost:8080 using only the standard library.

ЁЯзк Try it

python3 apigw/demo.py why
python3 - <<'EOF'
import sys; sys.path.insert(0, "apigw"); from demo import office
gw, clock = office()
for p in ("/students/7", "/students/9", "/teachers"):
    st, headers, out = gw.handle("GET", p)
    print(st, p, out)
print(gw.metrics)
print(gw.logs[-1])
EOF
python3 apigw/test_apigw.py

Now open the office for real and knock on the door with curl:

python3 apigw/demo.py serve &          # the office opens on localhost:8080
sleep 1                                # give the office a second to open
curl -i localhost:8080/students/7
curl -i localhost:8080/students/7      # the same question again
curl -i localhost:8080/teachers
kill %1                                # close the office

тЬЕ Verify тАФ what you should see

why prints GET /students/7 тЖТ 200 {'id': '7', 'name': 'Aishwarya', 'class': '8B'} X-Cache: Miss and GET /teachers тЖТ 404 {'message': 'Not Found'}. Your snippet prints 200 for /students/7 and /students/9, 404 /teachers {'message': 'Not Found'}, then the counters {'Count': 3, '4XXError': 1, '5XXError': 0, 'CacheHitCount': 0, 'CacheMissCount': 2} and the last visitor-book line: {'requestId': 'req-0003', 'stage': 'prod', 'httpMethod': 'GET', 'path': '/teachers', 'status': 404, 'principal': None, 'latencyMs': 4, 'integrationLatencyMs': 0}. The tests end with 12/12 passed.

With the live office: the server prints front office open on http://localhost:8080 (stage prod) тАФ Ctrl+C to close. The first curl shows HTTP/1.0 200 OK, X-Cache: Miss and {"id": "7", "name": "Aishwarya", "class": "8B"}; the second shows X-Cache: Hit тАФ the office answered from its notice board. /teachers shows HTTP/1.0 404 Not Found and {"message": "Not Found"}.

ЁЯПБ What you just proved

Every visitor passes one desk. The desk answered, counted, remembered and wrote down each visit тАФ and the kitchen was asked only when it had to be.

тЪая╕П Common mistakes

ЁЯПн In production

On a real account тАФ list your REST and HTTP APIs, and create an HTTP API in one command in front of an existing Lambda function ("quick create"):

aws apigateway get-rest-apis --query 'items[].{name:name,id:id}'
aws apigatewayv2 get-apis --query 'Items[].{name:Name,id:ApiId,type:ProtocolType}'
aws apigatewayv2 create-api --name school-api --protocol-type HTTP \
    --target arn:aws:lambda:ap-south-1:111122223333:function:students

ЁЯПн Why this matters in production: most AWS serverless systems put API Gateway in front of Lambda so that auth, throttling and logging live in one reviewed place. The first review question is simple: which routes exist, and who may call each one?

тПня╕П Next

The office exists. But AWS offers three kinds of front office тАФ a full one, a lean one, and one where the phone line stays open.

git checkout lesson-02-rest-http-websocket
тЖР Course homeall lessonsNext тЖТrest http websocket

This page is the lesson's README from the lesson-01-why-gateway branch, shown here so the whole School stays on one site. Code files open on GitHub at the same branch.