

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: AWS Lambda
incomplete
2: Deploy Lambda
incomplete
3: Testing Lambda Functions
incomplete
4: API Gateway
incomplete
5: CloudWatch Log Groups and Viewing Lambda Logs
incomplete
6: Other Lambda Use Cases
incomplete
7: Final Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Your Lambda function works, but it can only be invoked from the AWS CLI or AWS Console. To make it accessible over HTTP (so you can call it from a browser, mobile app, or any HTTP client), we need Amazon API Gateway.
API Gateway is a managed service that creates, publishes, and manages APIs. It sits in front of your Lambda function and handles much of what a web server or proxy would do. Have a look at this diagram:
Another critical concept: we can connect multiple Lambda functions to the same API Gateway. This lets us hook up arbitrary Lambda functions into a single application. It can be a wonderful convenience, or indecipherable spaghetti.
When you make an HTTP request through API Gateway, it captures your actual IP address and includes it in the event it sends to Lambda. Unlike CLI and AWS Console tests where you provide mock data, this is a real HTTP request traveling over the internet, so you'll see your real IP in the response!
I love prototype-driven development; it's a powerful tool to build a toy version of the app or feature you're thinking about to see what it would take to deploy it in production. API gateways and lambdas can be a great way to get your proof of concept online.
Create an API Gateway HTTP API named patientping-ip-api that exposes your Lambda function over HTTP. (Optional: repeat with the CLI.)
Cost check: API Gateway charges for HTTP requests and data transfer (pay-as-you-go). HTTP APIs run about $1.00 per million requests. This should put our testing in the less than $.01 category.
Run and submit the tests to verify your API Gateway is configured correctly.