Softwr

Software · head to head

AWS CloudFormation vs AWS WAF

AWS CloudFormation logo

AWS CloudFormation

Software

Declarative infrastructure as code for AWS, free for AWS resources

From
Free
Free plan
Yes
AWS WAF logo

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 CloudFormation is free; AWS WAF starts at $5/mo.
  • Only AWS CloudFormation lists stacks and templates; only AWS WAF lists web ACLs and rules.
  • Where AWS CloudFormation falls short: it only manages AWS, so multi-cloud estates need Terraform or Pulumi alongside it.
  • 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 CloudFormation and AWS WAF differ?

AWS CloudFormation and AWS WAF differ on starting price (Free against $5/month), pricing model and free tier (Yes against No). Only the attributes on which AWS CloudFormation and AWS WAF actually diverge.

Attributes where AWS CloudFormation and AWS WAF differ
AttributeAWS CloudFormationAWS WAF
Starting priceFree$5/month
Pricing modelNo charge for AWS resource types; extensions per handler operationPer web ACL, per rule and per million requests
Free tierYesNo
PlatformsWeb, Linux, macOS, WindowsWeb

Which features does each one have?

They share no listed features; 6 appear only for AWS CloudFormation 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 CloudFormation

  • Stacks and templates
  • Change sets
  • Drift detection
  • StackSets
  • Rollback
  • Registry extensions

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 CloudFormation is most often brought in for recreating identical dev, staging and production environments on AWS; 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 CloudFormation

  • Recreating identical dev, staging and production environments on AWSnot AWS WAF
  • Deploying one baseline of security resources across many accounts with StackSetsnot AWS WAF
  • Serverless applications packaged with AWS SAMnot AWS WAF
  • Previewing and auditing infrastructure changes through change setsnot AWS WAF

AWS WAF

  • Blocking SQL injection, cross-site scripting and known bad inputs in front of an Application Load Balancernot AWS CloudFormation
  • Rate limiting login and API endpoints that sit behind CloudFrontnot AWS CloudFormation
  • Adding bot detection to a retail site already hosted on AWSnot AWS CloudFormation
  • Applying one set of WAF rules across many accounts through AWS Firewall Managernot AWS CloudFormation

Where do AWS CloudFormation and AWS WAF fall short?

AWS CloudFormation's most cited limit: it only manages AWS, so multi-cloud estates need Terraform or Pulumi alongside it. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

AWS CloudFormation

  • It only manages AWS, so multi-cloud estates need Terraform or Pulumi alongside it
  • Raw templates are verbose and hard to reuse, which is why many teams add CDK on top
  • A failed update can leave a stack in a stuck state such as UPDATE_ROLLBACK_FAILED that needs manual intervention
  • New AWS features sometimes arrive in CloudFormation after the console and API, so you wait or script around the gap
  • Deleting a stack deletes its resources, so a mistaken delete of a stack with data needs DeletionPolicy discipline

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 CloudFormation and AWS WAF cost?

AWS CloudFormation is free to use; AWS WAF starts at $5/mo. Plan by plan below, from each vendor's own pricing page.

AWS CloudFormation

Free
  • AWS resource typesFree
    • No additional charge for using CloudFormation with AWS resources
    • You pay for the resources the stack creates
  • Third-party extensionsOn request
    • $0.0009 per handler operation, first 1,000 per month free
    • $0.00008 per second of handler duration beyond 30 seconds

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 CloudFormation if

  • You need stacks and templates.
  • You want to start without paying.
  • You work on Web, Linux, macOS, Windows.
  • You also want change sets.

Choose AWS WAF if

  • You need web acls and rules.
  • You also want managed rule groups.

Questions people ask

Is AWS CloudFormation or AWS WAF better?
It depends on the job. AWS CloudFormation fits recreating identical dev, staging and production environments on AWS; AWS WAF fits blocking SQL injection, cross-site scripting and known bad inputs in front of an Application Load Balancer. AWS CloudFormation starts at Free and AWS WAF at $5/month.
Which is cheaper, AWS CloudFormation or AWS WAF?
AWS CloudFormation has a free tier; the other does not. Paid plans start at Free for AWS CloudFormation and $5/month for AWS WAF.
Does AWS CloudFormation or AWS WAF run on more platforms?
AWS CloudFormation runs on Web, Linux, macOS, Windows. AWS WAF runs on Web.
Can I use AWS CloudFormation for free?
Yes. AWS CloudFormation has a free tier, so you can try it without paying. AWS WAF starts at $5/month.
What is AWS CloudFormation best used for?
AWS CloudFormation is most often used for recreating identical dev, staging and production environments on aws, deploying one baseline of security resources across many accounts with stacksets, serverless applications packaged with aws sam, previewing and auditing infrastructure changes through change sets. Of those, recreating identical dev, staging and production environments on aws and deploying one baseline of security resources across many accounts with stacksets are not what AWS WAF is typically brought in for.
What can AWS CloudFormation do that AWS WAF cannot?
AWS CloudFormation covers Stacks and templates, Change sets, Drift detection, StackSets. AWS WAF covers Web ACLs and rules, Managed rule groups, Bot Control, Fraud Control.

Answered from the vendors’ own pages

AWS CloudFormation: Does CloudFormation cost money?

Not for AWS resource types. You pay for the resources it creates; third-party extensions are billed at $0.0009 per handler operation after 1,000 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 CloudFormation: CloudFormation or Terraform?

CloudFormation is AWS-only with state managed by AWS; Terraform spans many providers and keeps its own state.

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 CloudFormation: How does CDK relate?

CDK lets you write infrastructure in a programming language and synthesises CloudFormation templates.

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.

Share

Related pages

Other head to heads