What if you could go from a blank screen to a fully deployed serverless API โ API Gateway, Lambda, DynamoDB, and all โ in under an hour? Kiro, AWS's agentic IDE, makes that possible. You describe what you want in plain English, and Kiro generates the spec, the infrastructure, and the application code.
In this article, I'll walk you through building a complete serverless CRUD API with Kiro and Terraform.
The main parts of this article:
1- About Kiro
2- Building a Serverless REST API with Kiro (API Gateway + Lambda + DynamoDB)
3- Key Takeaways
About
Kiro is an agentic development environment that makes it easy for developers to ship real engineering work with the help of AI agents. Kiro is our answer to the question โwhat would a development environment look like if it could take full advantage of AI?โ
Kiro operates as a standalone IDE (a fork of VS Code), which makes the environment feel very familiar.
After downloading it from their website, I authenticated using my AWS Builder ID โ the process was simple and straightforward.
Building a Serverless REST API with Kiro (API Gateway + Lambda + DynamoDB)
Prerequisites
- AWS account with credentials configured
- Node.js installed
- Kiro IDE installed (https://kiro.dev)
- Terraform installed (https://developer.hashicorp.com/terraform/install)
Step 1: Create a New Project in Kiro
- Open Kiro IDE
- Create a new project folder (e.g. kiro-serverless-api)
- Open the project in Kiro
Step 2: Write a Spec (Kiro's Spec-Driven Development)
- Open Kiro's spec panel
- Describe what you want to build in natural language:
"Build a CRUD REST API for managing tasks. Each task has an id, title, description, status, and createdAt. Use API Gateway for HTTP endpoints, Lambda for handlers, and DynamoDB for storage. Use Terraform for infrastructure."
- Kiro will generate a spec, design doc, and task list
- Review and approve the generated plan
Step 3: Let Kiro Generate the Code
- Kiro will create the project structure:
- Walk through each task Kiro generates and approve the code
Step 4: Review the Generated Infrastructure (Terraform)
- DynamoDB table with partition key (id)
- Lambda functions for each CRUD operation (create, get, list, update, delete)
- API Gateway REST API with routes mapped to Lambda functions
- IAM roles granting Lambda access to DynamoDB
Step 5: Review the Generated Lambda Handlers
Here is an example of a snippet that represents a spec task checklist item within a Spec-Driven Workflow.
- [ ] 4.2 Create API Gateway methods
- Define POST method on `/tasks` for task creation
- Define GET method on `/tasks` for listing all tasks
- Define GET method on `/tasks/{id}` for retrieving specific task
- Define PUT method on `/tasks/{id}` for updating task
- Define DELETE method on `/tasks/{id}` for deleting task
- Set authorization to NONE for all methods
- _Requirements: 7.1, 7.4_
Step 6: Install Dependencies
- npm install
Step 7: Deploy to AWS
- cd infra
- terraform init
- terraform plan (review what will be created)
- terraform apply (confirm with "yes")
- Note the API Gateway endpoint URL from the output
Step 8: Test the API
Make sure all endpoints are functioning as expected.
Step 9: Cleanup
- cd infra && terraform destroy (confirm with "yes")
Thatโs it โ in under one hour, you were able to build a fully functional serverless application by following a spec-driven workflow. This approach gives you the opportunity to review and validate each task individually, while allowing you to refine, adjust, or even change minor details as you go. ๐
Key Takeaways
- Kiro's spec-driven approach: describe -> spec -> design -> tasks -> code
- Kiro generates Terraform HCL files for AWS infrastructure
- Lambda handlers and API routes are generated from the spec
- Infrastructure and application code are created together
- End result: a fully deployed serverless API with minimal manual coding
Happy coding ๐จ๐ปโ๐ป
๐ก Enjoyed this? Letโs connect and geek out some more on LinkedIn.







Top comments (0)