Skip to Content

DDoS resiliency best practices

The AWS best practices for DDoS resiliency, BP1 to BP7, edge location mitigation, infrastructure and application layer defense, and attack surface reduction.

The reference architecture

A DDoS-resilient architecture: traffic from users and attackers first meets the edge, Route 53 (BP3), CloudFront (BP1) with AWS WAF (BP2) and Global Accelerator (BP1); it then reaches the Region, with API Gateway (BP4), a load balancer (BP6) and an Auto Scaling group (BP7) behind security groups and network ACLs (BP5); Shield Advanced protects CloudFront, Global Accelerator, Route 53, load balancers and Elastic IPs A DDoS-resilient architecture: traffic from users and attackers first meets the edge, Route 53 (BP3), CloudFront (BP1) with AWS WAF (BP2) and Global Accelerator (BP1); it then reaches the Region, with API Gateway (BP4), a load balancer (BP6) and an Auto Scaling group (BP7) behind security groups and network ACLs (BP5); Shield Advanced protects CloudFront, Global Accelerator, Route 53, load balancers and Elastic IPs

Absorb attacks at the edge, scale and filter in the Region.

AWS's DDoS resiliency whitepaper numbers its best practices BP1 to BP7:

  • BP1: CloudFront and Global Accelerator;
  • BP2: AWS WAF;
  • BP3: Route 53;
  • BP4: API Gateway;
  • BP5: security groups and network ACLs (in the VPC);
  • BP6: Elastic Load Balancing;
  • BP7: Auto Scaling.

Edge location mitigation (BP1, BP3)

  • BP1, CloudFront:
    • web application delivery at the edge;
    • protects from common DDoS attacks (SYN floods, UDP reflection…).
  • BP1, Global Accelerator:
    • access the application from the edge;
    • integrates with Shield for DDoS protection;
    • helpful if the backend isn't compatible with CloudFront (non-HTTP).
  • BP3, Route 53:
    • domain name resolution at the edge;
    • a DDoS protection mechanism.

Best practices for DDoS mitigation

  • Infrastructure layer defense (BP1, BP3, BP6):
    • protect EC2 against high traffic;
    • that includes using Global Accelerator, Route 53, CloudFront, Elastic Load Balancing.
  • EC2 with Auto Scaling (BP7): helps scale in case of sudden traffic surges, including a flash crowd or a DDoS attack.
  • Elastic Load Balancing (BP6): scales with traffic increases and distributes the traffic to many EC2 instances.

Application layer defense

  • Detect and filter malicious web requests (BP1, BP2):
    • CloudFront caches static content and serves it from edge locations, protecting the backend;
    • AWS WAF on CloudFront and the ALB filters and blocks requests based on request signatures;
    • WAF rate-based rules automatically block the IPs of bad actors;
    • use managed rules on WAF to block attacks based on IP reputation, or block anonymous IPs;
    • CloudFront can block specific geographies.
  • Shield Advanced (BP1, BP2, BP6): its automatic application layer DDoS mitigation creates, evaluates and deploys WAF rules to mitigate layer 7 attacks.

Attack surface reduction

  • Obfuscate AWS resources (BP1, BP4, BP6): use CloudFront, API Gateway and Elastic Load Balancing to hide the backend resources (Lambda functions, EC2 instances).
  • Security groups and network ACLs (BP5):
    • filter traffic based on specific IPs at the subnet or ENI level;
    • Elastic IPs are protected by AWS Shield Advanced.
  • Protect API endpoints (BP4):
    • hide EC2, Lambda and other backends;
    • edge-optimized mode, or CloudFront + Regional mode (more control for DDoS);
    • WAF + API Gateway: burst limits, header filtering, API keys.

Real-world examples

  • A ticketing site expects a flash crowd at 10:00. CloudFront caches the event pages, a WAF rate-based rule limits each IP, and the Auto Scaling group behind the ALB scales out. When attack traffic arrives at the same time, the edge absorbs most of it.

Exam tips

  • "Protect a web app from DDoS" → CloudFront (+ WAF rate-based rules) in front, ALB + Auto Scaling behind, Shield Advanced for more.
  • "Non-HTTP app needs edge DDoS protection" → Global Accelerator (+ Shield).
  • "Hide the backend" → put CloudFront, API Gateway or a load balancer in front, and lock down security groups.

Common traps

  • "Expose EC2 instances directly and rely on security groups." Put edge services and a load balancer in front to absorb and filter attacks.

Check yourself

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt