Softwr

Software · head to head

Amazon VPC vs AWS CodeBuild

Amazon VPC logo

Amazon VPC

Software

The private network layer for AWS, free to create with paid NAT, endpoints and addresses

From
Free
Free plan
Yes
AWS CodeBuild logo

AWS CodeBuild

Software

Pay-per-minute managed build service for compiling, testing and packaging code

From
$0.005/minute
Free plan
No

The short version

  • Amazon VPC has a free plan, then $0.005/mo; AWS CodeBuild starts at $0.005/mo.
  • Only Amazon VPC lists subnets and routing; only AWS CodeBuild lists managed build environments.
  • Where Amazon VPC falls short: every public IPv4 address costs about $3.60 a month, including idle ones, so unused elastic IPs quietly add cost.
  • 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.

How do Amazon VPC and AWS CodeBuild differ?

Amazon VPC and AWS CodeBuild differ on starting price (Free against $0.005/minute), pricing model and free tier (Yes against No). Only the attributes on which Amazon VPC and AWS CodeBuild actually diverge.

Attributes where Amazon VPC and AWS CodeBuild differ
AttributeAmazon VPCAWS CodeBuild
Starting priceFree$0.005/minute
Pricing modelFree VPC, metered NAT gateways, addresses and add-onsPer build minute by instance type
Free tierYesNo
PlatformsWebWeb, Linux, Windows

Which features does each one have?

They share no listed features; 6 appear only for Amazon VPC and 6 only for AWS CodeBuild. 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 Amazon VPC

  • Subnets and routing
  • Security groups and NACLs
  • NAT gateways
  • PrivateLink endpoints
  • Flow Logs and Traffic Mirroring
  • IPAM

Only in AWS CodeBuild

  • Managed build environments
  • Lambda and EC2 compute
  • Reserved capacity
  • Buildspec files
  • Caching
  • GitHub Actions runners

What is each one used for?

Amazon VPC is most often brought in for isolating production, staging and development workloads in separate networks; AWS CodeBuild for building and pushing container images to Amazon ECR from a CodePipeline stage. The jobs each tool is most often brought in to do.

Amazon VPC

  • Isolating production, staging and development workloads in separate networksnot AWS CodeBuild
  • Giving private subnets outbound access through a NAT gateway while blocking inbound trafficnot AWS CodeBuild
  • Reaching S3 and other AWS services over private endpoints to avoid NAT data chargesnot AWS CodeBuild
  • Capturing and mirroring traffic for intrusion detectionnot AWS CodeBuild

AWS CodeBuild

  • Building and pushing container images to Amazon ECR from a CodePipeline stagenot Amazon VPC
  • Running unit tests in parallel across many ephemeral containersnot Amazon VPC
  • Self-hosted GitHub Actions runners that need IAM access to AWS resourcesnot Amazon VPC
  • Compiling for Arm using cheaper Graviton-based build instancesnot Amazon VPC

Where do Amazon VPC and AWS CodeBuild fall short?

Amazon VPC's most cited limit: every public IPv4 address costs about $3.60 a month, including idle ones, so unused elastic IPs quietly add cost. AWS CodeBuild's: 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.

Amazon VPC

  • NAT gateways charge $0.045 per hour and $0.045 per GB, so private workloads pulling large data volumes from the internet can generate a large bill with no obvious source
  • Every public IPv4 address costs about $3.60 a month, including idle ones, so unused elastic IPs quietly add cost
  • Cross-Availability Zone traffic is billed per GB, so designs that spread chatty services across zones pay for the resilience in data transfer fees
  • Networking is regional and per account, so connecting many VPCs needs Transit Gateway or peering, each with its own pricing and limits
  • Security groups, NACLs and route tables are easy to misconfigure, and there is no built-in policy checking beyond tools such as Reachability Analyzer, which is billed per analysis

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

How much do Amazon VPC and AWS CodeBuild cost?

Amazon VPC has a free plan, with paid plans from $0.005/mo; AWS CodeBuild starts at $0.005/mo. Plan by plan below, from each vendor's own pricing page.

Amazon VPC

Free
  • VPC, subnets and security groupsFree
    • No charge to create a VPC, subnets, route tables, security groups or network ACLs
  • NAT Gateway$0.045/hour
    • $0.045 per hour per gateway
    • $0.045 per GB processed
    • Regional NAT Gateway is $0.045 per hour per Availability Zone
  • Public IPv4 address$0.005/hour
    • $0.005 per hour, in use or idle
    • Traffic mirroring $0.015 per session hour
    • IPAM Advanced Tier $0.00027 per active IP address hour

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

Which should you pick?

Choose Amazon VPC if

  • You need subnets and routing.
  • You want to start without paying.
  • You also want security groups and nacls.

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 Amazon VPC or AWS CodeBuild better?
It depends on the job. Amazon VPC fits isolating production, staging and development workloads in separate networks; AWS CodeBuild fits building and pushing container images to Amazon ECR from a CodePipeline stage. Amazon VPC starts at Free and AWS CodeBuild at $0.005/minute.
Which is cheaper, Amazon VPC or AWS CodeBuild?
Amazon VPC has a free tier; the other does not. Paid plans start at Free for Amazon VPC and $0.005/minute for AWS CodeBuild.
Does Amazon VPC or AWS CodeBuild run on more platforms?
Amazon VPC runs on Web. AWS CodeBuild runs on Web, Linux, Windows.
Can I use Amazon VPC for free?
Yes. Amazon VPC has a free tier, so you can try it without paying. AWS CodeBuild starts at $0.005/minute.
What is Amazon VPC best used for?
Amazon VPC is most often used for isolating production, staging and development workloads in separate networks, giving private subnets outbound access through a nat gateway while blocking inbound traffic, reaching s3 and other aws services over private endpoints to avoid nat data charges, capturing and mirroring traffic for intrusion detection. Of those, isolating production, staging and development workloads in separate networks and giving private subnets outbound access through a nat gateway while blocking inbound traffic are not what AWS CodeBuild is typically brought in for.
What can Amazon VPC do that AWS CodeBuild cannot?
Amazon VPC covers Subnets and routing, Security groups and NACLs, NAT gateways, PrivateLink endpoints. AWS CodeBuild covers Managed build environments, Lambda and EC2 compute, Reserved capacity, Buildspec files.

Answered from the vendors’ own pages

Amazon VPC: Is Amazon VPC free?

Creating a VPC, subnets, route tables and security groups is free. NAT gateways, public IPv4 addresses, traffic mirroring and PrivateLink endpoints are charged.

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.

Amazon VPC: How much does a NAT gateway cost?

$0.045 per hour in US East plus $0.045 per GB processed, per the AWS pricing page, before standard data transfer charges.

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.

Amazon VPC: Are public IPv4 addresses charged?

Yes. $0.005 per hour per public IPv4 address, whether in use or idle.

AWS CodeBuild: Can CodeBuild run GitHub Actions?

Yes. CodeBuild can act as managed runners for GitHub Actions workflows, billed at CodeBuild compute rates.

Share

Related pages

Other head to heads