Developer Tools · head to head
AWS CDK vs AWS Lambda

AWS CDK
Developer Tools
Open source framework for defining AWS infrastructure in programming languages
- From
- Free
- Free plan
- Yes

AWS Lambda
Cloud
Run code without thinking about servers
- From
- Free
- Free plan
- Yes
The short version
- AWS CDK is an Apache 2; AWS Lambda is a serverless compute service.
- Both are free.
- Only AWS CDK lists construct Library of reusable components; only AWS Lambda lists event-driven execution.
- Where AWS CDK falls short: targets AWS only, so it does not provision resources on other clouds.
- Where AWS Lambda falls short: provisioned concurrency, used to avoid cold starts, is charged separately at $0.0000041667 per GB-second whether or not the function runs.
How do AWS CDK and AWS Lambda differ?
AWS CDK and AWS Lambda differ on pricing model (Open-source against Usage-based), platforms and category (Developer Tools against Cloud). Only the attributes on which AWS CDK and AWS Lambda actually diverge.
| Attribute | AWS CDK | AWS Lambda |
|---|---|---|
| Pricing model | Open-source | Usage-based |
| Platforms | Windows, macOS, Linux | Web, API |
| Category | Developer Tools | Cloud |
Identical on both: starting price (Free), free tier (Yes).
Not yet recorded: founded for AWS CDK.
Which features does each one have?
They share no listed features; 8 appear only for AWS CDK and 20 only for AWS Lambda. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.
Only in AWS CDK
- Construct Library of reusable components
- CDK CLI for synthesis and deployment
- Programmatic CDK Toolkit Library
- Support for TypeScript, JavaScript, Python, Java, C# and Go
- Deployment through AWS CloudFormation
- Custom and shareable constructs
- Construct Hub registry
- Open source under Apache 2.0
Only in AWS Lambda
- Function-as-a-Service
- Event-driven execution
- Auto-scaling
- Pay-per-use
- Multiple languages
- Concurrency limits
- Dead Letter Queues
- Environment variables
What is each one used for?
AWS CDK is most often brought in for defining AWS infrastructure in TypeScript or Python; AWS Lambda for event-driven functions without managing servers. The jobs each tool is most often brought in to do.
AWS CDK
- Defining AWS infrastructure in TypeScript or Pythonnot AWS Lambda
- Reusable internal infrastructure modulesnot AWS Lambda
- Serverless application stacksnot AWS Lambda
- Testing infrastructure with unit testsnot AWS Lambda
- Standardising environments across accountsnot AWS Lambda
AWS Lambda
- Event-driven functions without managing serversnot AWS CDK
- API backends behind API Gatewaynot AWS CDK
- Processing S3, DynamoDB, SQS and Kinesis eventsnot AWS CDK
- Scheduled jobs without a always-on instancenot AWS CDK
- Edge compute through Lambda@Edgenot AWS CDK
Where do AWS CDK and AWS Lambda fall short?
AWS CDK's most cited limit: targets AWS only, so it does not provision resources on other clouds. AWS Lambda's: ephemeral storage beyond the included 512 MB is metered. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.
AWS CDK
- Targets AWS only, so it does not provision resources on other clouds
- Deploys through CloudFormation, so its resource coverage and limits apply
- Infrastructure written in code can be harder to review than declarative templates
- The AWS resources it creates are billed separately at standard AWS rates
AWS Lambda
- Billed on two axes at once, $0.20 per million requests plus $0.0000166667 per GB-second of duration, so memory settings change the bill as much as traffic does
- Provisioned concurrency, used to avoid cold starts, is charged separately at $0.0000041667 per GB-second whether or not the function runs
- Ephemeral storage beyond the included 512 MB is metered
- Lambda@Edge costs $0.60 per million requests, three times the standard request rate
- VPC use and cross-region data transfer carry EC2 charges on top
How much do AWS CDK and AWS Lambda cost?
AWS CDK is free to use; AWS Lambda is free to use. Plan by plan below, from each vendor's own pricing page.
AWS CDK
FreeNo published plan breakdown. See the AWS CDK review.
AWS Lambda
Free- Free TierFree
- 1M free requests/month
- 400,000 GB-seconds/month
- Always free
Which should you pick?
Choose AWS CDK if
- You need construct library of reusable components.
- You want to start without paying.
- You work on Windows, macOS, Linux.
- You also want cdk cli for synthesis and deployment.
Choose AWS Lambda if
- You need function-as-a-service.
- You want to start without paying.
- You work on Web, API.
- You also want event-driven execution.
Questions people ask
- Is AWS CDK or AWS Lambda better?
- It depends on the job. AWS CDK fits defining AWS infrastructure in TypeScript or Python; AWS Lambda fits event-driven functions without managing servers. AWS CDK starts at Free and AWS Lambda at Free.
- Which is cheaper, AWS CDK or AWS Lambda?
- AWS CDK starts at Free and AWS Lambda at Free.
- Does AWS CDK or AWS Lambda run on more platforms?
- AWS CDK runs on Windows, macOS, Linux. AWS Lambda runs on Web, API.
- Can I use AWS CDK for free?
- Both have a free tier, so you can try either at no cost before committing.
- What is AWS CDK best used for?
- AWS CDK is most often used for defining aws infrastructure in typescript or python, reusable internal infrastructure modules, serverless application stacks, testing infrastructure with unit tests. Of those, defining aws infrastructure in typescript or python and reusable internal infrastructure modules are not what AWS Lambda is typically brought in for.
- What can AWS CDK do that AWS Lambda cannot?
- AWS CDK covers Construct Library of reusable components, CDK CLI for synthesis and deployment, Programmatic CDK Toolkit Library, Support for TypeScript, JavaScript, Python, Java, C# and Go. AWS Lambda covers Function-as-a-Service, Event-driven execution, Auto-scaling, Pay-per-use.
Answered from the vendors’ own pages
AWS CDK: Which languages does AWS CDK support?
The AWS documentation lists TypeScript, JavaScript, Python, Java, C# and .NET, and Go. Infrastructure is defined as constructs composed into stacks and apps.
SourceAWS Lambda: Is there a free tier for AWS Lambda?
Yes. AWS Lambda offers a free tier including 1 million requests per month, 400,000 GB-seconds per month, and 100 GB monthly response streaming.
SourceAWS CDK: How does AWS CDK deploy resources?
CDK apps are synthesised and deployed through AWS CloudFormation. The documentation states this gives predictable, repeatable deployments with rollback on error.
SourceAWS Lambda: How is AWS Lambda charged?
Lambda charges $0.20 per million requests. Duration charges are $0.0000166667 per GB-second for x86 (up to 6 billion GB-seconds/month in US East Ohio with tiered pricing). Ephemeral storage over the included 512 MB costs $0.0000000309 per GB-second. Provisioned Concurrency costs $0.0000041667 per GB-second with a 5-minute minimum.
SourceAWS CDK: Is AWS CDK free?
It is open source under the Apache 2.0 licence according to its GitHub repository. The AWS resources you provision with it are charged at their normal rates.
SourceAWS Lambda: What are Lambda Durable Functions pricing?
Lambda Durable Functions include operations at $8.00 per million (start execution, steps, waits). Data written costs $0.25 per GB. Data retention is $0.15 per GB-month with configurable 1-90 day retention (default 14 days).
SourceAWS CDK: When was AWS CDK first released?
Wikipedia reports a developer preview announced in 2018 and general availability on 11 July 2019. CDK v2 followed in 2021.
SourceRelated pages
Other head to heads
- AWS CDK vs Terraform
- AWS CDK vs HCP Terraform
- AWS CDK vs Atlantis
- AWS CDK vs Pants Build
- AWS CDK vs Frappe
- AWS CDK vs Eclipse
- AWS CDK vs Spacelift
- AWS CDK vs Python
- AWS CDK vs Backstage
- AWS CDK vs Jitsu
- AWS CDK vs Notepad++
- AWS CDK vs Steampipe
- AWS CDK vs iTerm2
- AWS CDK vs JFrog Artifactory
- AWS CDK vs Leafmap
- AWS CDK vs LocalStack
- AWS CDK vs OrbStack
- AWS CDK vs PhpStorm
- AWS CDK vs Google Cloud Run
- AWS CDK vs Deno Deploy
- AWS CDK vs Azure Functions
- AWS CDK vs Serverless Framework
- AWS CDK vs Cerebrium
- AWS CDK vs Koyeb
- AWS CDK vs Beam Cloud
- AWS CDK vs Lambda
- AWS CDK vs Porter
- AWS CDK vs Terragrunt
- AWS CDK vs Vultr
- AWS CDK vs Heroku
- AWS CDK vs OVHcloud
- AWS CDK vs Rancher
- AWS CDK vs HAProxy
- AWS CDK vs IBM Cloud
- AWS CDK vs Northflank
- AWS CDK vs K3s
- AWS Lambda vs Terraform
- AWS Lambda vs HCP Terraform
- AWS Lambda vs Atlantis
- AWS Lambda vs Pants Build
- AWS Lambda vs Frappe
- AWS Lambda vs Eclipse
- AWS Lambda vs Spacelift
- AWS Lambda vs Python
- AWS Lambda vs Backstage
- AWS Lambda vs Jitsu
- AWS Lambda vs Notepad++
- AWS Lambda vs Steampipe
- AWS Lambda vs iTerm2
- AWS Lambda vs JFrog Artifactory
- AWS Lambda vs Leafmap
- AWS Lambda vs LocalStack
- AWS Lambda vs OrbStack
- AWS Lambda vs PhpStorm
- AWS Lambda vs Google Cloud Run
- AWS Lambda vs Deno Deploy
- AWS Lambda vs Azure Functions
- AWS Lambda vs Serverless Framework
- AWS Lambda vs Cerebrium
- AWS Lambda vs Koyeb
- AWS Lambda vs Beam Cloud
- AWS Lambda vs Lambda
- AWS Lambda vs Porter
- AWS Lambda vs Terragrunt
- AWS Lambda vs Vultr
- AWS Lambda vs Heroku
- AWS Lambda vs OVHcloud
- AWS Lambda vs Rancher
- AWS Lambda vs HAProxy
- AWS Lambda vs IBM Cloud
- AWS Lambda vs Northflank
- AWS Lambda vs K3s
