Software · head to head
AWS CodeBuild vs AWS WAF

AWS CodeBuild
Software
Pay-per-minute managed build service for compiling, testing and packaging code
- From
- $0.005/minute
- Free plan
- No

AWS WAF
Software
Managed web application firewall for CloudFront, load balancers and APIs on AWS
- From
- $5/month
- Free plan
- No
The short version
- AWS CodeBuild starts at $0.005/mo, AWS WAF at $5/mo.
- Only AWS CodeBuild lists lambda and EC2 compute; only AWS WAF lists web ACLs and rules.
- Where AWS CodeBuild falls short: billing is rounded per minute on EC2 compute, so many short jobs cost more than their actual run time suggests.
- Where AWS WAF falls short: it only attaches to a fixed list of AWS resources, so applications hosted outside AWS or behind another CDN cannot use it.
How do AWS CodeBuild and AWS WAF differ?
AWS CodeBuild and AWS WAF differ on starting price ($0.005/minute against $5/month), pricing model and platforms. Only the attributes on which AWS CodeBuild and AWS WAF actually diverge.
| Attribute | AWS CodeBuild | AWS WAF |
|---|---|---|
| Starting price | $0.005/minute | $5/month |
| Pricing model | Per build minute by instance type | Per web ACL, per rule and per million requests |
| Platforms | Web, Linux, Windows | Web |
Identical on both: free tier (No).
Which features does each one have?
They share no listed features; 6 appear only for AWS CodeBuild and 6 only for AWS WAF. 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 CodeBuild
- Managed build environments
- Lambda and EC2 compute
- Reserved capacity
- Buildspec files
- Caching
- GitHub Actions runners
Only in AWS WAF
- Web ACLs and rules
- Managed rule groups
- Bot Control
- Fraud Control
- Rate-based rules
- Logging
What is each one used for?
AWS CodeBuild is most often brought in for building and pushing container images to Amazon ECR from a CodePipeline stage; AWS WAF for rate limiting login and API endpoints that sit behind CloudFront. The jobs each tool is most often brought in to do.
AWS CodeBuild
- Building and pushing container images to Amazon ECR from a CodePipeline stagenot AWS WAF
- Running unit tests in parallel across many ephemeral containersnot AWS WAF
- Self-hosted GitHub Actions runners that need IAM access to AWS resourcesnot AWS WAF
- Compiling for Arm using cheaper Graviton-based build instancesnot AWS WAF
AWS WAF
- Blocking SQL injection, cross-site scripting and known bad inputs in front of an Application Load Balancernot AWS CodeBuild
- Rate limiting login and API endpoints that sit behind CloudFrontnot AWS CodeBuild
- Adding bot detection to a retail site already hosted on AWSnot AWS CodeBuild
- Applying one set of WAF rules across many accounts through AWS Firewall Managernot AWS CodeBuild
Where do AWS CodeBuild and AWS WAF fall short?
AWS CodeBuild's most cited limit: billing is rounded per minute on EC2 compute, so many short jobs cost more than their actual run time suggests. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.
AWS CodeBuild
- Each build starts from a clean environment, so dependency installs and image pulls repeat unless caching is configured, which inflates build minutes
- Billing is rounded per minute on EC2 compute, so many short jobs cost more than their actual run time suggests
- There is no built-in repository, pipeline UI or code review, so you need CodePipeline or a third-party system to trigger and track releases
- Windows and larger instance types cost several times the Linux small rate, and the pricing table has dozens of instance rows to compare
- Debugging a failed build is slower than on a local runner because you rely on logs or session manager rather than a persistent machine
AWS WAF
- It only attaches to a fixed list of AWS resources, so applications hosted outside AWS or behind another CDN cannot use it
- Charges come from several meters at once (web ACL, rules, rule groups, requests, logging, and per-feature fees), so predicting a bill needs a worksheet rather than a single price
- Account Takeover Prevention and Fraud Control start at $1,000 per million requests, so protecting a busy login endpoint can cost more than the web ACL itself
- Managed rules ship in count-first workflows and generate false positives on unusual payloads, so someone has to review logs and tune exclusions
- Request body inspection is capped by default, and inspecting beyond the limit or using more than the default capacity units carries extra per-request charges
How much do AWS CodeBuild and AWS WAF cost?
AWS CodeBuild starts at $0.005/mo; AWS WAF starts at $5/mo. Plan by plan below, from each vendor's own pricing page.
AWS CodeBuild
$0.005/minute- Linux general1.small$0.005/minute
- 3 GB memory, 2 vCPUs
- 100 free build minutes per month on general1.small or arm1.small
- Linux general1.large$0.02/minute
- 15 GB memory, 8 vCPUs
- general1.2xlarge is $0.20 per minute
- Lambda compute$0.00001/second
- Billed per second from $0.00001 (1 GB Arm) to $0.0002 (10 GB x86-64)
- Suited to short builds
AWS WAF
$5/month- Pay-as-you-go$5/mo
- $5.00 per web ACL per month
- $1.00 per rule and $1.00 per rule group per month
- $0.60 per million requests
- Bot Control$10/mo
- $10.00 per web ACL per month subscription
- Common: $1.00 per million requests, first 10 million free
- Targeted: $10.00 per million requests, first million free
- Account Takeover and Fraud Control$10/mo
- $10.00 per web ACL per month per rule group
- $1,000 per million requests for the first 2 million, falling to $50 per million at the highest tier
Which should you pick?
Choose AWS CodeBuild if
- You need managed build environments.
- You work on Web, Linux, Windows.
- You also want lambda and ec2 compute.
Questions people ask
- Is AWS CodeBuild or AWS WAF better?
- It depends on the job. AWS CodeBuild fits building and pushing container images to Amazon ECR from a CodePipeline stage; AWS WAF fits blocking SQL injection, cross-site scripting and known bad inputs in front of an Application Load Balancer. AWS CodeBuild starts at $0.005/minute and AWS WAF at $5/month.
- Which is cheaper, AWS CodeBuild or AWS WAF?
- AWS CodeBuild starts at $0.005/minute and AWS WAF at $5/month.
- Does AWS CodeBuild or AWS WAF run on more platforms?
- AWS CodeBuild runs on Web, Linux, Windows. AWS WAF runs on Web.
- What is AWS CodeBuild best used for?
- AWS CodeBuild is most often used for building and pushing container images to amazon ecr from a codepipeline stage, running unit tests in parallel across many ephemeral containers, self-hosted github actions runners that need iam access to aws resources, compiling for arm using cheaper graviton-based build instances. Of those, building and pushing container images to amazon ecr from a codepipeline stage and running unit tests in parallel across many ephemeral containers are not what AWS WAF is typically brought in for.
- What can AWS CodeBuild do that AWS WAF cannot?
- AWS CodeBuild covers Managed build environments, Lambda and EC2 compute, Reserved capacity, Buildspec files. AWS WAF covers Web ACLs and rules, Managed rule groups, Bot Control, Fraud Control.
Answered from the vendors’ own pages
AWS CodeBuild: How much does CodeBuild cost?
Linux general1.small is $0.005 per build minute, general1.medium $0.01 and general1.large $0.02, per the AWS pricing page. 100 build minutes per month on small instances are free.
AWS WAF: How much does AWS WAF cost per month?
On pay-as-you-go pricing it is $5.00 per web ACL and $1.00 per rule per month, plus $0.60 per million requests, per the AWS pricing page. Bot Control, fraud rules, CAPTCHA and logging are billed on top.
AWS CodeBuild: Does CodeBuild replace Jenkins?
It replaces the build agents, not the orchestration. You still need CodePipeline, webhooks or another trigger for pipeline logic.
AWS WAF: Does AWS WAF work outside AWS?
No. It protects supported AWS resources such as CloudFront, Application Load Balancer and API Gateway. Origins elsewhere can be covered if they sit behind CloudFront.
AWS CodeBuild: Can CodeBuild run GitHub Actions?
Yes. CodeBuild can act as managed runners for GitHub Actions workflows, billed at CodeBuild compute rates.
AWS WAF: Is AWS WAF included with Shield Advanced?
Shield Advanced includes WAF usage for protected resources, up to 50 billion requests per month and 1,500 capacity units per web ACL, per the Shield pricing page.
Related pages
More on AWS CodeBuild
Keep looking
Other head to heads
- AWS CodeBuild vs Buildkite
- AWS CodeBuild vs Garden
- AWS CodeBuild vs LocalStack
- AWS CodeBuild vs Travis CI
- AWS CodeBuild vs Trunk Code Quality
- AWS CodeBuild vs GitLab CI/CD
- AWS CodeBuild vs Bazel
- AWS CodeBuild vs Depot
- AWS CodeBuild vs Nx Cloud
- AWS CodeBuild vs Tilt
- AWS CodeBuild vs Apache Maven
- AWS CodeBuild vs Cloudflare Workers
- AWS CodeBuild vs Claude Code
- AWS CodeBuild vs Postman
- AWS CodeBuild vs Keycloak
- AWS CodeBuild vs Cody
- AWS CodeBuild vs GitHub
- AWS CodeBuild vs GitLab
- AWS CodeBuild vs Imperva
- AWS CodeBuild vs FortiWeb
- AWS CodeBuild vs Sucuri
- AWS CodeBuild vs Wordfence
- AWS CodeBuild vs Sophos Firewall
- AWS CodeBuild vs Clerk
- AWS CodeBuild vs Transcend
- AWS CodeBuild vs Hanwha Vision
- AWS CodeBuild vs Baffle
- AWS CodeBuild vs Cisco Secure Firewall
- AWS CodeBuild vs Palo Alto Networks Next-Generation Firewall
- AWS CodeBuild vs Dashlane
- AWS CodeBuild vs Mullvad VPN
- AWS CodeBuild vs JumpCloud
- AWS CodeBuild vs Genetec Security Center
- AWS CodeBuild vs Microsoft Sentinel
- AWS CodeBuild vs IVPN
- AWS CodeBuild vs FortiMail
- AWS WAF vs Buildkite
- AWS WAF vs Garden
- AWS WAF vs LocalStack
- AWS WAF vs Travis CI
- AWS WAF vs Trunk Code Quality
- AWS WAF vs GitLab CI/CD
- AWS WAF vs Bazel
- AWS WAF vs Depot
- AWS WAF vs Nx Cloud
- AWS WAF vs Tilt
- AWS WAF vs Apache Maven
- AWS WAF vs Cloudflare Workers
- AWS WAF vs Claude Code
- AWS WAF vs Postman
- AWS WAF vs Keycloak
- AWS WAF vs Cody
- AWS WAF vs GitHub
- AWS WAF vs GitLab
- AWS WAF vs Imperva
- AWS WAF vs FortiWeb
- AWS WAF vs Sucuri
- AWS WAF vs Wordfence
- AWS WAF vs Sophos Firewall
- AWS WAF vs Clerk
- AWS WAF vs Transcend
- AWS WAF vs Hanwha Vision
- AWS WAF vs Baffle
- AWS WAF vs Cisco Secure Firewall
- AWS WAF vs Palo Alto Networks Next-Generation Firewall
- AWS WAF vs Dashlane
- AWS WAF vs Mullvad VPN
- AWS WAF vs JumpCloud
- AWS WAF vs Genetec Security Center
- AWS WAF vs Microsoft Sentinel
- AWS WAF vs IVPN
- AWS WAF vs FortiMail
