Build a serverless API
We’ll build the classic serverless API: API Gateway → Lambda → DynamoDB. Here’s the shape you’re heading toward — the same node-graph you’ll see on the canvas:
The shape
Section titled “The shape”- Add an API Gateway (HTTP) node and connect the canonical Internet entrypoint to it.
- Add a Lambda and connect the API Gateway route to it.
- Add a DynamoDB table; wire it to the Lambda’s data port.
- Add an IAM role and wire it to the Lambda’s execution role socket.
Why the sockets matter
Section titled “Why the sockets matter”Because each port carries its Terraform argument, the generated HCL references the specific table and the specific role you wired — never “the first one it finds”. This is what keeps multi-resource designs (two roles, several tables) correct. See the node reference for every socket each resource exposes.
Export
Section titled “Export”Open the Terraform view and download the project, or copy the canonical HCL. Everything is validated
against the AWS provider schema before you ever run terraform apply.
Go further
Section titled “Go further”The same pattern scales. An event-driven system fans work out through SNS/SQS to worker Lambdas:
A 3-tier web app puts an ALB in front of an autoscaling ECS service backed by RDS and a cache: