Build a Serverless CRUD API on AWS
Build a REST API with Lambda, API Gateway, and DynamoDB.
Introduction
30 Second Summary
Every time you check a product price, add something to a cart, or look up an order status, an API is working behind the scenes. APIs are how applications talk to each other, and building one is a core skill for any cloud engineer.
In this project, you will build a serverless REST API on AWS that manages a product inventory. You'll connect Lambda, API Gateway, and DynamoDB into a working system that handles Create, Read, and Delete operations through live HTTP endpoints.
What You'll Build
A serverless REST API that stores and retrieves product data (id, name, price) through four HTTP routes, powered entirely by AWS managed services with zero servers to maintain.
By the end of this project, you'll have:
- A DynamoDB table storing product inventory data with a partition key for fast lookups.
- A Python Lambda function that routes HTTP requests and performs CRUD operations using boto3.
- A publicly accessible invoke URL exposed through API Gateway that you can call from anywhere.
- Secret Mission: Harden your API with input validation, error handling, and CORS headers to make it production-ready.
Are there any prerequisites?
You'll need an AWS Free Tier account and intermediate Python knowledge. No local tools are required. Everything in this project happens inside the AWS Management Console.
Set Up Your AWS Console Environment
Before you build anything on AWS, you need a properly configured console environment. Every service you create in this project needs to live in the same region so they can talk to each other.
In this step, you'll confirm your AWS Management Console access, lock your region to US East (N. Virginia), and verify your Free Tier status.
In this step, get ready to:
- Sign in to the AWS Management Console.
- Set your region to US East (N. Virginia).
- Verify your Free Tier status.
Sign in to the AWS Management Console
The AWS Management Console is the web interface where you create and manage all your AWS resources. You need either the root user or an IAM user with full administrator permissions to complete this project.
- Open https://console.aws.amazon.com in your browser.
- Sign in with your root user email and password, or use an IAM user that has AdministratorAccess.
What is IAM?
IAM (Identity and Access Management) controls who can do what in your AWS account. A root user has full access to everything, while IAM users can be given limited permissions.
For this project, you need either the root user or an IAM user with AdministratorAccess so you can create DynamoDB tables, Lambda functions, and API Gateway endpoints.
Set your region to US East (N. Virginia)
AWS has data centers around the world, grouped into regions. All services in this project must be in the same region to work together.
- Look at the top-right corner of the console, next to your account name.
- Click the region selector dropdown.
- Select US East (N. Virginia).
The region selector should now display us-east-1.
Why US East (N. Virginia)?
US East (N. Virginia) is the oldest and most commonly used AWS region. It typically receives new features first and has full Free Tier coverage for every service in this project.
Verify your Free Tier status
Every service you create in this project falls within the AWS Free Tier. Confirming your Free Tier status now ensures nothing you build today costs money.
- Click the search bar at the top of the console.
- Type Billing and select Billing and Cost Management from the results.
- Confirm you can see your Free Tier usage tracking on the dashboard.
What does the Free Tier cover for this project?
DynamoDB provides 25 GB of storage, 25 write capacity units, and 25 read capacity units per month (Always Free).
Lambda provides 1,000,000 free requests and 400,000 GB-seconds of compute per month (Always Free). API Gateway provides 1,000,000 API calls per month free for 12 months.
Can't find Billing and Cost Management?
If you're using an IAM user, the account administrator may need to enable IAM access to billing. Try signing in with the root user instead, or ask your administrator to activate the Activate IAM Access setting in account settings.
Help me access the Billing and Cost Management dashboard in my AWS console.
Your console is configured and ready to go. Next up, you'll create your first AWS resource: a DynamoDB table to store your product inventory data.
Create a DynamoDB Table
Your AWS Console is set up and your free tier is confirmed. Now it's time to create the database that stores your API's data.
Every API needs somewhere to keep its data. In this step, you'll create a DynamoDB table that holds product inventory items. Each item gets a unique ID that acts as its lookup key.
In this step, get ready to:
- Create a DynamoDB table called http-crud-tutorial-items.
- Verify the table status is Active and locate its ARN.
Create the http-crud-tutorial-items table
DynamoDB is a fully managed NoSQL database. You don't need to provision servers or install software. You just create a table and start reading and writing data.
- Open the DynamoDB console by navigating to https://console.aws.amazon.com/dynamodb/ in your browser.
- Choose Create table.
- For Table name, enter http-crud-tutorial-items.
- For Partition key, enter id. Leave the type set to String.
- Leave all other settings as their defaults.
- Choose Create table.
What is a partition key?
A partition key is the primary identifier for each item in your table. DynamoDB uses it to distribute data across its internal storage and to look up individual items quickly.
In this project, each product has a unique id string. When your API needs to retrieve or delete a specific product, it uses this id to find exactly the right item.
Verify your table is active
DynamoDB takes a few seconds to provision your table. Once it's ready, the status changes to Active.
- Wait for the table status to show Active in the tables list.
- Click the table name http-crud-tutorial-items to open it.
- Select the Overview tab.
- Scroll down to General information and find the Amazon Resource Name (ARN).
- Note this ARN somewhere handy. This is the unique identifier for your table across all of AWS.
What is an ARN?
An ARN (Amazon Resource Name) is like a full address for any resource in AWS. It includes the service name, region, account ID, and resource name all in one string.
Other AWS services use this ARN to identify your table when they need permission to access it. You'll see this pattern throughout AWS.
Why is this table free?
DynamoDB's Always Free tier includes 25 GB of storage, 25 write capacity units (WCU), and 25 read capacity units (RCU) per month. The manual testing you'll do in this project uses a tiny fraction of that allowance.
Table stuck in Creating status?
If your table stays in Creating status for more than 30 seconds, try refreshing the page. DynamoDB tables with default settings typically become Active within a few seconds.
If the table still doesn't appear, double-check that your region is set to US East (N. Virginia) in the top-right corner of the console.
Help me troubleshoot my DynamoDB table creation.
Your database is ready to store product data. Next up, you'll create the Lambda function that reads and writes to this table.
Create the Lambda Function
Your DynamoDB table is ready and waiting for data. Now you need something to put data into it.
AWS Lambda lets you run code without managing servers. In this step, you'll create a Python function that receives HTTP requests and translates them into DynamoDB operations like creating, reading, and deleting items.
In this step, get ready to:
- Create a Lambda function with an IAM role that has DynamoDB permissions.
- Deploy the Python CRUD handler code.
- Test the function with a simulated API request.
Create the function and execution role
Every Lambda function needs an execution role. This IAM role defines what AWS services the function is allowed to interact with. You'll create both the function and its role in one step using a policy template.
- Open the Lambda console by entering Lambda in the console search bar at the top of the page, then selecting Lambda from the results.
- Click Create function.
- Select Author from scratch.
- For Function name, enter http-crud-tutorial-function.
- For Runtime, choose Python 3.13.
- Under Permissions, expand Change default execution role.
- Select Create a new role from AWS policy templates.
- For Role name, enter http-crud-tutorial-role.
- For Policy templates, search for and select Simple microservice permissions.
- Click Create function.
You should see a success banner at the top of the page confirming your function was created.
What did this set up?
You created two things at once. The Lambda function http-crud-tutorial-function is where your code will run. The IAM role http-crud-tutorial-role gives your function permission to read and write to DynamoDB and send logs to CloudWatch.
The Simple microservice permissions policy template is a shortcut that grants exactly the DynamoDB access your function needs.
Don't see Python 3.13 in the dropdown?
Make sure your region is still set to US East (N. Virginia) us-east-1 in the top-right corner. If you still don't see it, select the closest available Python version (such as Python 3.12). The code in this project works on any Python 3.12+ runtime.
Help me troubleshoot my Lambda function creation
Add the CRUD handler code
Lambda created a default "Hello World" function for you. You'll replace it with the code that handles all four CRUD operations for your API.
- In the Code tab, you should see the built-in code editor with a file called lambda_function.py.
- Select all the existing code in the editor and replace it with the following:
import json
import boto3
from decimal import Decimal
client = boto3.client('dynamodb')
dynamodb = boto3.resource("dynamodb")
table = dynamodb.Table('http-crud-tutorial-items')
tableName = 'http-crud-tutorial-items'
def lambda_handler(event, context):
print(event)
body = {}
statusCode = 200
headers = {
"Content-Type": "application/json"
}
try:
if event['routeKey'] == "DELETE /items/{id}":
table.delete_item(
Key={'id': event['pathParameters']['id']})
body = 'Deleted item ' + event['pathParameters']['id']
elif event['routeKey'] == "GET /items/{id}":
body = table.get_item(
Key={'id': event['pathParameters']['id']})
body = body["Item"]
responseBody = [
{'price': float(body['price']), 'id': body['id'], 'name': body['name']}]
body = responseBody
elif event['routeKey'] == "GET /items":
body = table.scan()
body = body["Items"]
responseBody = []
for items in body:
responseItems = [
{'price': float(items['price']), 'id': items['id'], 'name': items['name']}]
responseBody.append(responseItems)
body = responseBody
elif event['routeKey'] == "PUT /items":
requestJSON = json.loads(event['body'])
table.put_item(
Item={
'id': requestJSON['id'],
'price': Decimal(str(requestJSON['price'])),
'name': requestJSON['name']
})
body = 'Put item ' + requestJSON['id']
except KeyError:
statusCode = 400
body = 'Unsupported route: ' + event['routeKey']
body = json.dumps(body)
res = {
"statusCode": statusCode,
"headers": {
"Content-Type": "application/json"
},
"body": body
}
return res
What does this code do?
This function is the brain of your API. It reads the routeKey from incoming requests to decide which operation to perform.
- DELETE /items/{id} removes an item from the table by its ID.
- GET /items/{id} retrieves a single item by its ID.
- GET /items scans the entire table and returns all items.
- PUT /items creates a new item from the request body.
The function uses boto3, the AWS SDK for Python, to communicate with DynamoDB. It's already included in the Lambda runtime so you don't need to install anything.
- Click Deploy to save your function code.
You should see a banner that says your function has been updated successfully.
Don't see the Deploy button?
Look for the Deploy button in the Code source pane above the editor. Make sure you pasted the code into the lambda_function.py tab (not a new file). If you accidentally created a new file, delete it and paste into the existing lambda_function.py tab instead.
Help me deploy my Lambda function code
✔️ Awesome, I've got everything!
Great. Double check you see the success banner confirming deployment before moving on.
ⓧ I'd like to double check the full code
Here is the complete lambda_function.py file. Make sure your editor matches this exactly:
import json
import boto3
from decimal import Decimal
client = boto3.client('dynamodb')
dynamodb = boto3.resource("dynamodb")
table = dynamodb.Table('http-crud-tutorial-items')
tableName = 'http-crud-tutorial-items'
def lambda_handler(event, context):
print(event)
body = {}
statusCode = 200
headers = {
"Content-Type": "application/json"
}
try:
if event['routeKey'] == "DELETE /items/{id}":
table.delete_item(
Key={'id': event['pathParameters']['id']})
body = 'Deleted item ' + event['pathParameters']['id']
elif event['routeKey'] == "GET /items/{id}":
body = table.get_item(
Key={'id': event['pathParameters']['id']})
body = body["Item"]
responseBody = [
{'price': float(body['price']), 'id': body['id'], 'name': body['name']}]
body = responseBody
elif event['routeKey'] == "GET /items":
body = table.scan()
body = body["Items"]
responseBody = []
for items in body:
responseItems = [
{'price': float(items['price']), 'id': items['id'], 'name': items['name']}]
responseBody.append(responseItems)
body = responseBody
elif event['routeKey'] == "PUT /items":
requestJSON = json.loads(event['body'])
table.put_item(
Item={
'id': requestJSON['id'],
'price': Decimal(str(requestJSON['price'])),
'name': requestJSON['name']
})
body = 'Put item ' + requestJSON['id']
except KeyError:
statusCode = 400
body = 'Unsupported route: ' + event['routeKey']
body = json.dumps(body)
res = {
"statusCode": statusCode,
"headers": {
"Content-Type": "application/json"
},
"body": body
}
return res
Test the function with a simulated request
Before connecting your function to an API, you should verify it works on its own. Lambda's built-in test feature lets you simulate an incoming request.
- Click the Test tab.
- Under Test event, select Create new event.
- For Event name, enter test-get-items.
- Replace the default JSON in the Event JSON section with the following:
{"routeKey": "GET /items"}
What does this test event simulate?
This JSON mimics what API Gateway will send to your function when someone hits the GET /items route. The routeKey field tells your function which operation to perform.
- Click Test.
Under Execution result, expand Details. You should see a response with statusCode of 200 and an empty list [] as the body. The list is empty because your DynamoDB table has no items yet.
Seeing an error instead of a 200 response?
If you see a KeyError or a 400 status, double-check that your test event JSON is exactly {"routeKey": "GET /items"}. A typo in the key name will cause the function to fall into the exception handler.
If you see an AccessDeniedException, your IAM role may not have the correct permissions. Go to the Configuration tab, then Permissions, and verify the role name shows http-crud-tutorial-role.
Help me debug my Lambda test execution
Your function is tested and working. Next, you'll create an HTTP API in API Gateway and wire it up to this Lambda function so the world can reach it.
Create the HTTP API and Connect Everything
Your Lambda function is deployed and tested. Now you need a way for the outside world to actually reach it.
API Gateway is the front door to your serverless backend. It receives HTTP requests from the internet, routes them to the correct Lambda function, and returns the response. Without it, your function sits isolated inside AWS with no public endpoint.
In this step, get ready to:
- Create an HTTP API in API Gateway.
- Define four routes for your CRUD operations.
- Connect each route to your Lambda function via an integration.
Create the HTTP API
An HTTP API is the lightweight, low-cost option in API Gateway designed for Lambda-backed APIs. You will create an empty API first, then add routes and integrations manually.
- Open the API Gateway console at https://console.aws.amazon.com/apigateway.
- Choose Create API.
- Under HTTP API, choose Build.
- For API name, enter http-crud-tutorial-api.
- For IP address type, select IPv4.
- Choose Next.
- For Configure routes, choose Next to skip route creation. You will create routes manually in the next substep.
- Review the stage that API Gateway creates for you, then choose Next.
- Choose Create.
What is an HTTP API?
API Gateway offers two types of REST-style APIs: REST APIs and HTTP APIs. HTTP APIs are designed with minimal features so they can be offered at a lower price. They support Lambda integrations, automatic deployments, and CORS configuration out of the box.
For a single Lambda-backed API like yours, HTTP APIs are the modern, recommended choice.
You should now see your http-crud-tutorial-api listed in the API Gateway console with a $default stage.
Don't see your API?
Make sure you chose Build under the HTTP API section, not the REST API section. They look similar but lead to different consoles.
Also confirm your region is still set to US East (N. Virginia) us-east-1 in the top-right corner.
Help me troubleshoot my API Gateway setup.
Create four routes
Routes tell API Gateway which HTTP method and path combination should trigger your Lambda function. You need four routes to support all CRUD operations.
- Choose Routes in the left navigation panel.
- Choose Create.
- For Method, choose GET.
- For the path, enter /items/{id}.
- Choose Create.
- Repeat the same steps to create three more routes: GET /items, PUT /items, and DELETE /items/{id}.
What is {id} in the path?
The {id} at the end of a path is a path parameter. API Gateway extracts this value from the URL when a client makes a request.
For example, a request to /items/abc123 passes abc123 as the id parameter to your Lambda function. Your function then uses that value to look up or delete a specific item in DynamoDB.
You should now see all four routes listed on the Routes page.
Missing a route?
Check that you selected the correct HTTP method (GET, PUT, or DELETE) for each route. A common mistake is creating two GET routes with the same path.
If you made a typo, select the incorrect route, choose Delete, and recreate it with the correct method and path.
Help me fix my API Gateway routes.
Create and attach the Lambda integration
An integration connects a route to a backend service. You will create one Lambda integration and attach it to all four routes so every request goes to the same function.
- Choose Integrations in the left navigation panel.
- Choose Manage integrations, then choose Create.
- Skip Attach this integration to a route. You will attach it to routes in the next step.
- For Integration type, choose Lambda function.
- For Lambda function, enter http-crud-tutorial-function.
- Choose Create.
Now attach this integration to all four routes.
- Return to Integrations in the left panel.
- Choose a route (e.g. GET /items/{id}).
- Under Choose an existing integration, select http-crud-tutorial-function.
- Choose Attach integration.
- Repeat for the remaining three routes: GET /items, PUT /items, and DELETE /items/{id}.
Why one integration for all routes?
Your single Lambda function handles all four operations by reading the routeKey from the event (e.g. GET /items or DELETE /items/{id}). API Gateway passes the route information automatically, so one integration covers all your CRUD logic.
Verify that all four routes display an AWS Lambda integration attached. You can confirm this on the Integrations page. Each route should show http-crud-tutorial-function as its integration target.
- Note your API's invoke URL. Choose your API name to go to the Details page and find the Invoke URL field.
- Copy this URL and save it somewhere handy. It looks like https://abcdef123.execute-api.us-east-1.amazonaws.com. You will use it to test your API in the next step.
A route is missing its integration?
If a route shows no integration attached, select that route on the Integrations page, choose http-crud-tutorial-function under Choose an existing integration, and choose Attach integration.
Help me attach my Lambda integration to my API Gateway routes.
Your API is fully wired up. API Gateway will route incoming requests to your Lambda function, which reads the routeKey and performs the correct DynamoDB operation. Next, you will test this live API with real HTTP requests.
Test Your Live API
Your API is live and publicly accessible on the internet. Anyone with the invoke URL can send HTTP requests to it, and your Lambda function handles the rest.
In this step, you'll prove everything works end-to-end by calling each route from PowerShell on your local machine. You'll create an item, retrieve it, delete it, and check the logs to confirm every invocation was captured.
In this step, get ready to:
- Create an item in DynamoDB through a PUT request.
- Retrieve items using GET requests.
- Delete an item and confirm removal.
Create an item using PowerShell
Your API's invoke URL is the public address that routes requests through API Gateway to your Lambda function. You'll send a PUT request with a JSON body containing an item's id, name, and price.
- Press the Windows key to open your search bar.
- Type PowerShell and press Enter to open it.
- Find your invoke URL in the API Gateway console by selecting your API and looking at the Details section on the left panel.
- Create an item in your DynamoDB table by running this command:
Invoke-RestMethod -Method PUT -Uri "[[INVOKE_URL="your API invoke URL (e.g. https://abc123.execute-api.us-east-1.amazonaws.com)"]]/items" -Body '{"id": "123", "price": 100, "name": "Widget"}' -ContentType "application/json"
You should see the response:
Put item 123
What does this command do?
This command sends an HTTP PUT request to your API's /items route. API Gateway receives the request, triggers your Lambda function, and Lambda writes the item to DynamoDB.
- -Method PUT tells PowerShell to send a PUT request (which your Lambda maps to a create operation).
- -Body contains the JSON payload with your item's data.
- -ContentType "application/json" tells the server the body is JSON.
Seeing an error instead of the response?
- Double-check that your invoke URL is correct. It should look like https://abcdef123.execute-api.us-east-1.amazonaws.com with no trailing slash before /items.
- Make sure the JSON body uses double quotes inside and single quotes on the outside. PowerShell uses single quotes to wrap strings containing double quotes.
- If you see a 500 error, return to the Lambda console and confirm your function was deployed successfully (look for a green banner that says Successfully updated the function).
Help me troubleshoot my PowerShell API request.
Retrieve items with GET requests
Now that an item exists in your table, you can retrieve it two ways. A GET to /items returns all items, and a GET to /items/{id} returns one specific item.
- Retrieve all items in your table by running:
Invoke-RestMethod -Method GET -Uri "[[INVOKE_URL="your API invoke URL"]]/items"
You should see a response containing your Widget item with its id, name, and price.
- Retrieve the specific item by its ID by running:
Invoke-RestMethod -Method GET -Uri "[[INVOKE_URL="your API invoke URL"]]/items/123"
You should see just the single item with id of 123, name of Widget, and price of 100.
Why two GET routes?
This is a common REST API pattern. One endpoint lists all resources (like browsing a catalog), and another retrieves a single resource by its unique identifier (like opening one product page).
Your Lambda function uses the routeKey from the API Gateway event to decide which operation to run. GET /items triggers a full table scan, while GET /items/{id} fetches a single item by its partition key.
Getting an empty response?
- Confirm your PUT request succeeded in the previous substep. You should have seen Put item 123 as the response.
- Check that the invoke URL matches exactly. A typo in the URL creates a new route that doesn't exist on your API.
Help me figure out why my GET request returns empty.
Delete an item and verify in CloudWatch
The final operation removes an item by its ID. After deleting, you'll run GET again to confirm the table is empty, then check CloudWatch logs to see every Lambda invocation recorded.
- Delete the item you created by running:
Invoke-RestMethod -Method DELETE -Uri "[[INVOKE_URL="your API invoke URL"]]/items/123"
You should see the response:
Deleted item 123
- Confirm the item is gone by running:
Invoke-RestMethod -Method GET -Uri "[[INVOKE_URL="your API invoke URL"]]/items"
You should see an empty response, confirming the item was successfully removed from DynamoDB.
- Return to the AWS Console in your browser.
- Navigate to the Lambda console and select your http-crud-tutorial-function.
- Click the Monitor tab.
- Click View CloudWatch logs.
You should see a log group named /aws/lambda/http-crud-tutorial-function with recent log streams. Click into the latest log stream to see the event data from each API request you just made.
What is CloudWatch?
CloudWatch is AWS's monitoring service. Every time your Lambda function runs, it automatically writes logs here. You'll see the print(event) output from your code, showing the full API Gateway event object that triggered each invocation.
This is your go-to tool for debugging serverless functions in production. If something breaks, the logs tell you exactly what request came in and where the code failed.
No log streams showing up?
- It can take 10-30 seconds for new logs to appear. Click the refresh icon in the CloudWatch console.
- Confirm your region is still set to US East (N. Virginia) in the top-right corner. Logs only appear in the same region as the function.
- If the log group doesn't exist at all, your Lambda function may not have executed. Re-run one of the PowerShell commands and refresh.
Help me find my Lambda logs in CloudWatch.
Your serverless API is fully operational. You've proven that every route works, data persists in DynamoDB, and CloudWatch captures the evidence. Ready to take it further? The secret mission turns this working prototype into something production-ready.
Secret mission
Make the API Production-Ready
Your API works, but it's fragile. What happens if someone sends a request with missing fields, or tries to fetch an item that doesn't exist? In this secret mission, you'll harden your Lambda function with input validation, structured error responses, and CORS headers.
Clean Up Your Resources
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely.
All services in this project fall within the AWS Free Tier. Lambda and DynamoDB are Always Free, and API Gateway HTTP APIs are free for 12 months (1M calls/month). Since these are serverless services, they only run when invoked and cost nothing while idle.
Resources you used:
- DynamoDB table: http-crud-tutorial-items (Always Free tier).
- Lambda function: http-crud-tutorial-function (Always Free tier).
- HTTP API: http-crud-tutorial-api (free for 12 months).
- IAM role: http-crud-tutorial-role (no cost).
- CloudWatch log group: /aws/lambda/http-crud-tutorial-function (minimal free tier storage).
Keep everything running
No action needed. Choose this if you are still actively building or plan to extend the API soon.
- All five resources are serverless and only incur charges when invoked.
- With zero traffic, your monthly cost is $0.
- After 12 months, the API Gateway free tier expires. If you have no traffic, the cost remains negligible.
Pause - I'll come back to this later
Remove the public API endpoint to prevent external access while keeping your Lambda function and DynamoDB data intact for later.
- Open the API Gateway console at https://console.aws.amazon.com/apigateway.
- On the APIs page, select http-crud-tutorial-api.
- Choose Actions, then choose Delete.
- Choose Delete to confirm.
Your Lambda function and DynamoDB table remain ready. When you return, create a new HTTP API and re-attach the integration.
Delete - I don't want to use this again
Remove all project resources and start fresh. Delete in this order to avoid dependency errors.
Delete the HTTP API:
- Open the API Gateway console at https://console.aws.amazon.com/apigateway.
- On the APIs page, select http-crud-tutorial-api.
- Choose Actions, then choose Delete.
- Choose Delete to confirm.
Delete the Lambda function:
- Open the Functions page of the Lambda console at https://console.aws.amazon.com/lambda.
- Select http-crud-tutorial-function.
- Choose Actions, then Delete.
- Type confirm in the text input field and choose Delete.
Delete the DynamoDB table:
- Open the DynamoDB console at https://console.aws.amazon.com/dynamodb.
- In the left navigation pane, choose Tables.
- Select the checkbox beside http-crud-tutorial-items.
- Choose Delete.
- Enter delete in the text box and choose Delete table.
Delete the IAM role:
- Open the IAM console at https://console.aws.amazon.com/iam.
- In the navigation pane, choose Roles.
- Search for http-crud-tutorial-role and select the checkbox next to it.
- Choose Delete at the top of the page.
- Enter the role name in the text input field and choose Delete.
Delete the CloudWatch log group:
- Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch.
- In the left navigation pane, choose Log groups.
- Select the checkbox beside /aws/lambda/http-crud-tutorial-function.
- Choose Actions, then Delete log group(s).
- Choose Delete to confirm.
That's a Wrap!
That's a Wrap!
Nice work! You just built a fully functional serverless REST API running on AWS. From a single HTTP request to a stored database record, every piece of this system runs without a single server to manage.
You've learned how to:
- Built a DynamoDB table and wrote a Python Lambda function that routes HTTP events and performs CRUD operations using boto3.
- Created an HTTP API with four routes in API Gateway and connected them to your Lambda function via a Lambda integration.
- Tested a live, publicly accessible API endpoint using PowerShell and monitored execution logs in CloudWatch.
- Secret Mission: Hardened the API with input validation, error handling, and CORS headers for production readiness.
Ready to quiz yourself?